Apache Zeta Components Manual :: Docs For Class ezcWebdavHeaderHandler
Webdav::ezcWebdavHeaderHandler
Class ezcWebdavHeaderHandler
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// |
Member Variables
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. |
Method Summary
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. |
Methods
parseAuthorizationHeader
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.
Parameters:
Name | Type | Description |
---|---|---|
$value |
string | |
$serverHeaderName |
string |
parseBasicAuthorizationHeader
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.
Parameters:
Name | Type | Description |
---|---|---|
$value |
string |
parseDepthHeader
Parses the Depth header.
Parses the values '0', '1' and 'infinity' into the corresponding constants:
- {@linkezcWebdavRequest::DEPTH_ZERO}
- {@linkezcWebdavRequest::DEPTH_ONE}
- {@linkezcWebdavRequest::DEPTH_INFINITY}
If the header contains a different value it is left as is.
Parameters:
Name | Type | Description |
---|---|---|
$value |
string |
parseDigestAuthorizationHeader
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.
Parameters:
Name | Type | Description |
---|---|---|
$value |
string |
parseHeader
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.
Parameters:
Name | Type | Description |
---|---|---|
$headerName |
string |
parseHeaders
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().
Parameters:
Name | Type | Description |
---|---|---|
$headerNames |
array(string) | |
$defaultHeaders |
bool |
Exceptions:
Type | Description |
---|---|
ezcWebdavUnknownHeaderException |
if a header requested in $headerNames is not known in $headerNames. |
parseIfMatchHeader
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.
Parameters:
Name | Type | Description |
---|---|---|
$value |
string |
processHeader
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.
Parameters:
Name | Type | Description |
---|---|---|
$headerName |
string | |
$value |
string | |
$serverHeaderName |
string |