Basic HTTP headers collection functionality Handles aggregation of headers.
More...
|
| setPluginClassLoader (PluginClassLocator $pluginClassLoader) |
| Set an alternate implementation for the PluginClassLoader.
|
|
| getPluginClassLoader () |
| Return an instance of a PluginClassLocator, lazyload and inject map if necessary.
|
|
| addHeaders ($headers) |
| Add many headers at once.
|
|
| addHeaderLine ($headerFieldNameOrLine, $fieldValue=null) |
| Add a raw header line, either in name => value, or as a single string 'name: value'.
|
|
| addHeader (Header\HeaderInterface $header) |
| Add a Header to this container, for raw values.
|
|
| removeHeader (Header\HeaderInterface $header) |
| Remove a Header from the container.
|
|
| clearHeaders () |
| Clear all headers.
|
|
| get ($name) |
| Get all headers of a certain name/type.
|
|
| has ($name) |
| Test for existence of a type of header.
|
|
| next () |
| Advance the pointer for this object as an iterator.
|
|
| key () |
| Return the current key for this object as an iterator.
|
|
| valid () |
| Is this iterator still valid?
|
|
| rewind () |
| Reset the internal pointer for this object as an iterator.
|
|
| current () |
| Return the current value for this iterator, lazy loading it if need be.
|
|
| count () |
| Return the number of headers in this contain, if all headers have not been parsed, actual count could increase if MultipleHeader objects exist in the Request/Response.
|
|
| toString () |
| Render all headers at once.
|
|
| toArray () |
| Return the headers container as an array.
|
|
| forceLoading () |
| By calling this, it will force parsing and loading of all headers, after this count() will be accurate.
|
|
|
static | fromString ($string) |
| Populates headers from string representation.
|
|
|
static | createKey ($name) |
| Create array key from header name.
|
|
Basic HTTP headers collection functionality Handles aggregation of headers.
- See Also
- http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
addHeaderLine |
( |
|
$headerFieldNameOrLine, |
|
|
|
$fieldValue = null |
|
) |
| |
Add a raw header line, either in name => value, or as a single string 'name: value'.
This method allows for lazy-loading in that the parsing and instantiation of Header object will be delayed until they are retrieved by either get() or current()
- Exceptions
-
Exception\InvalidArgumentException | |
- Parameters
-
string | $headerFieldNameOrLine | |
string | $fieldValue | optional |
- Returns
- Headers
Add many headers at once.
Expects an array (or Traversable object) of type/value pairs.
- Parameters
-
array | Traversable | $headers | |
- Returns
- Headers
- Exceptions
-
Exception\InvalidArgumentException | |
Clear all headers.
Removes all headers from queue
- Returns
- Headers
Return the number of headers in this contain, if all headers have not been parsed, actual count could increase if MultipleHeader objects exist in the Request/Response.
If you need an exact count, iterate
- Returns
- int count of currently known headers
static createKey |
( |
|
$name | ) |
|
|
staticprotected |
Create array key from header name.
- Parameters
-
- Returns
- string
Return the current value for this iterator, lazy loading it if need be.
- Returns
- array|Header
By calling this, it will force parsing and loading of all headers, after this count() will be accurate.
- Returns
- bool
static fromString |
( |
|
$string | ) |
|
|
static |
Populates headers from string representation.
Parses a string for headers, and aggregates them, in order, in the current instance, primarily as strings until they are needed (they will be lazy loaded)
- Parameters
-
- Returns
- Headers
- Exceptions
-
Exception\RuntimeException | |
Get all headers of a certain name/type.
- Parameters
-
- Returns
- bool|Header|ArrayIterator
Return an instance of a PluginClassLocator, lazyload and inject map if necessary.
- Returns
- PluginClassLocator
Test for existence of a type of header.
- Parameters
-
- Returns
- bool
Return the current key for this object as an iterator.
- Returns
- mixed
- Parameters
-
- Returns
- mixed|void
Advance the pointer for this object as an iterator.
- Returns
- void
Remove a Header from the container.
- Parameters
-
Header\HeaderInterface | $header | |
- Returns
- bool
Reset the internal pointer for this object as an iterator.
- Returns
- void
Set an alternate implementation for the PluginClassLoader.
- Parameters
-
\Zend\Loader\PluginClassLocator | $pluginClassLoader | |
- Returns
- Headers
Return the headers container as an array.
- Todo:
- determine how to produce single line headers, if they are supported
- Returns
- array
Render all headers at once.
This method handles the normal iteration of headers; it is up to the concrete classes to prepend with the appropriate status/request line.
- Returns
- string
Is this iterator still valid?
- Returns
- bool
$pluginClassLoader = null |
|
protected |