Webdav: ezcWebdavResponse
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWebdavResponse
|
Base class for all response objects. [
source]
This base class must be extended by all response representation classes.
Descendents
Constants
Properties
Member Variables
|
public array |
$errorNames
= array( self::STATUS_100 => 'Continue', self::STATUS_101 => 'Switching Protocols',
self::STATUS_200 => 'OK', self::STATUS_201 => 'Created', self::STATUS_202 => 'Accepted', self::STATUS_203 => 'Non-Authoritative Information', self::STATUS_204 => 'No Content', self::STATUS_205 => 'Reset Content', self::STATUS_206 => 'Partial Content', self::STATUS_207 => 'Multi-Status',
self::STATUS_300 => 'Multiple Choices', self::STATUS_301 => 'Moved Permanently', self::STATUS_302 => 'Moved Temporarily', self::STATUS_303 => 'See Other', self::STATUS_304 => 'Not Modified', self::STATUS_305 => 'Use Proxy',
self::STATUS_400 => 'Bad Request', self::STATUS_401 => 'Unauthorized', self::STATUS_402 => 'Payment Required', self::STATUS_403 => 'Forbidden', self::STATUS_404 => 'Not Found', self::STATUS_405 => 'Method Not Allowed', self::STATUS_406 => 'Not Acceptable', self::STATUS_407 => 'Proxy Authentication Required', self::STATUS_408 => 'Request Time-out', self::STATUS_409 => 'Conflict', self::STATUS_410 => 'Gone', self::STATUS_411 => 'Length Required', self::STATUS_412 => 'Precondition Failed', self::STATUS_413 => 'Request Entity Too Large', self::STATUS_414 => 'Request-URI Too Large', self::STATUS_415 => 'Unsupported Media Type', self::STATUS_423 => 'Locked', self::STATUS_424 => 'Failed Dependency',
self::STATUS_500 => 'Internal Server Error', self::STATUS_501 => 'Not Implemented', self::STATUS_502 => 'Bad Gateway', self::STATUS_503 => 'Service Unavailable', self::STATUS_504 => 'Gateway Time-out', self::STATUS_505 => 'HTTP Version not supported', self::STATUS_507 => 'Insufficient Storage', )
User readable names for error status codes |
|
protected array(string=>mixed) |
$headers
= array()
Container for header information. |
|
protected array(string=>mixed) |
$properties
= array( 'responseDescription' => null, )
Container to hold the properties |
Method Summary
|
public mixed |
getHeader(
$headerName )
Returns the contents of a specific header. |
|
public array(string=>string) |
getHeaders(
)
Returns all headers. |
|
public void |
setHeader(
$headerName, $headerValue )
Sets a header to a specified value. |
|
public void |
__construct(
[$status = self::STATUS_200] )
Construct error response from status. |
|
public void |
validateHeaders(
)
Validates the headers set in this request. |
|
public string |
__toString(
)
Return valid HTTP response string from error code. |
Methods
getHeader
mixed getHeader(
string
$headerName )
Returns the contents of a specific header.
Returns the content of the header identified with $headerName with the given name and null if no content for the header is available.
Parameters
| Name |
Type |
Description |
$headerName |
string |
|
getHeaders
array(string=>string) getHeaders(
)
Returns all headers.
setHeader
void setHeader(
string
$headerName, mixed
$headerValue )
Sets a header to a specified value.
Sets the value for $header to $headerValue. All processable headers will be validated centrally in
validateHeaders().
Parameters
| Name |
Type |
Description |
$headerName |
string |
|
$headerValue |
mixed |
|
__construct
void __construct(
[int
$status = self::STATUS_200] )
Construct error response from status.
Parameters
| Name |
Type |
Description |
$status |
int |
|
Redefined in descendants as
validateHeaders
void validateHeaders(
)
Validates the headers set in this request.
This method is called by ezcWebdavServer after the response object has been created by an ezcWebdavBackend. It must validate all headers specific for this request for existance of required headers and validity of all headers used by the specific request implementation. The call of the parent method is *mandatory* to have common WebDAV and HTTP headers validated, too!
Throws
| Class | Description |
ezcWebdavMissingHeaderException |
if a required header is missing. |
ezcWebdavInvalidHeaderException |
if a header is present, but its content does not validate. |
Redefined in descendants as
__toString
string __toString(
)
Return valid HTTP response string from error code.
Last updated: Mon, 12 Nov 2007