An instance of this class manages header parsing and handling.
An object of this class takes care about headers in ezcWebdavTransport. It is responsible for parsing incoming headers and serialize outgoing ones. Like for the ezcWebdavPropertyHandler, the instance of this class that is used in the current transport layer must be accessable for plugins.
Source for this file: /Webdav/src/transports/header_handler.php
Version: | //autogen// |
protected array(string) |
$defaultHeaders
= array(
List of headers that should be attempted to parse for every request. |
protected array(string=>string) |
$headerMap
= array(
Map of regular header names to $_SERVER keys. |
protected array(string) |
parseAuthorizationHeader(
$value
, $serverHeaderName
)
Parses the Authorization header. |
protected ezcWebdavBasicAuth |
parseBasicAuthorizationHeader(
$value
)
Parses the basic authorization header. |
protected int|string |
parseDepthHeader(
$value
)
Parses the Depth header. |
protected ezcWebdavDigestAuth|ezcWebdavBasicAuth |
parseDigestAuthorizationHeader(
$value
)
Parses the digest authorization header. |
public mixed |
parseHeader(
$headerName
)
Parses a single header. |
public array(string=>mixed) |
parseHeaders(
[ $headerNames
= array()] , [ $defaultHeaders
= true] )
Returns an array with the given headers. |
protected array |
parseIfMatchHeader(
$value
)
Parses the If-Match and If-None-Match headers. |
protected mixed |
processHeader(
$headerName
, $value
, $serverHeaderName
)
Processes a single header value. |
Parses the Authorization header.
Takes the string value of the Authorization header and parses it according to the Basic authentication scheme. The return value is an struct of either of the following classes:
In case the header is provided but does not contain a parseable value, the user and pass fields are null. The $serverHeaderName parameter indicates, which key from the $_SERVER array was used to extract the header.
Name | Type | Description |
---|---|---|
$value |
string | |
$serverHeaderName |
string |
Parses the basic authorization header.
Returns a struct of type ezcWebdavBasicAuth, containing the parsed values, or with empty username and password, if the header could not be parsed.
Name | Type | Description |
---|---|---|
$value |
string |
Parses the Depth header.
Parses the values '0', '1' and 'infinity' into the corresponding constants:
If the header contains a different value it is left as is.
Name | Type | Description |
---|---|---|
$value |
string |
Parses the digest authorization header.
Returns an authorization credential struct of type ezcWebdavDigestAuth, containing the parsed data, or an instance of ezcWebdavBasicAuth with empty username and password, if parsing failed.
Name | Type | Description |
---|---|---|
$value |
string |
Parses a single header.
Retrieves a $headerName and returns the processed value for it, if it does exist. If the requested header is unknown, a ezcWebdavUnknownHeaderException is thrown. If the requested header is not present in $_SERVER null is returned.
Name | Type | Description |
---|---|---|
$headerName |
string |
Returns an array with the given headers.
Checks for the availability of headers in $headerNamess, given as an array of header names, and parses them according to their format.
By default, this method parses an additional set of default headers (e.g. If-Match and If-None-Match). This can be avoided by setting the optional $defaultHeaders parameter to false.
The returned array can be used with ezcWebdavRequest->setHeaders().
Name | Type | Description |
---|---|---|
$headerNames |
array(string) | |
$defaultHeaders |
bool |
Type | Description |
---|---|
ezcWebdavUnknownHeaderException |
if a header requested in $headerNames is not known in $headerNames. |
Parses the If-Match and If-None-Match headers.
We do not pay attention to weak entity tags (prefixed by W\), since our backends don't make use of such tags. If backends want to provide weak entity tags, they still might do so.
Name | Type | Description |
---|---|---|
$value |
string |
Processes a single header value.
Takes the $headerName and $value of a header and parses the value accordingly, * if necessary. Returns the parsed or unmanipuled result. The $serverHeaderName parameter contains the key that was used to extract the header from the $_SERVER array.
Name | Type | Description |
---|---|---|
$headerName |
string | |
$value |
string | |
$serverHeaderName |
string |