Zend\Http\Headers
Basic HTTP headers collection functionality Handles aggregation of headers
Synopsis
class Headers
implements
Countable,Iterator
{
- // members
- protected PluginClassLoader $pluginClassLoader;
- protected array $headersKeys;
- protected array $headers;
- // methods
- public static Headers fromString()
- public Headers setPluginClassLoader()
- public PluginClassLocator getPluginClassLoader()
- public Headers addHeaders()
- public Headers addHeaderLine()
- public Headers addHeader()
- public bool removeHeader()
- public Headers clearHeaders()
- public HeaderInterface|ArrayIterator get()
- public bool has()
- public void next()
- public mixed key()
- public bool valid()
- public void rewind()
- public HeaderInterface current()
- public int count()
- public string toString()
- public array toArray()
- public bool forceLoading()
- protected mixed|void lazyLoadHeader()
- protected static string createKey()
Hierarchy
Tasks
Line | Task |
---|---|
383+ | determine how to produce single line headers, if they are supported |
Members
protected
- $headers — array
- $headersKeys — array
- $pluginClassLoader — Zend\Http\PluginClassLoader
Methods
protected
- createKey() — Create array key from header name
- lazyLoadHeader()
public
- addHeader() — Add a Header to this container, for raw values @see addHeaderLine() and addHeaders()
- addHeaderLine() — Add a raw header line, either in name => value, or as a single string 'name: value'
- addHeaders() — Add many headers at once
- clearHeaders() — Clear all headers
- 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. If you need an exact count, iterate
- current() — Return the current value for this iterator, lazy loading it if need be
- forceLoading() — By calling this, it will force parsing and loading of all headers, after this count() will be accurate
- fromString() — Populates headers from string representation
- get() — Get all headers of a certain name/type
- getPluginClassLoader() — Return an instance of a PluginClassLocator, lazyload and inject map if necessary
- has() — Test for existence of a type of header
- key() — Return the current key for this object as an iterator
- next() — Advance the pointer for this object as an iterator
- removeHeader() — Remove a Header from the container
- rewind() — Reset the internal pointer for this object as an iterator
- setPluginClassLoader() — Set an alternate implementation for the PluginClassLoader
- toArray() — Return the headers container as an array
- toString() — Render all headers at once
- valid() — Is this iterator still valid?