ILIAS
release_4-4 Revision
|
Public Member Functions | |
HTTP_Response (&$sock, &$listeners) | |
Constructor. More... | |
process ($saveBody=true, $canHaveBody=true) | |
Processes a HTTP response. More... | |
_processHeader ($header) | |
Processes the response header. More... | |
_parseCookie ($headervalue) | |
Parse a Set-Cookie header to fill $_cookies array. More... | |
_readChunked () | |
Read a part of response body encoded with chunked Transfer-Encoding. More... | |
_notify ($event, $data=null) | |
Notifies all registered listeners of an event. More... | |
_decodeGzip ($data) | |
Decodes the message-body encoded by gzip. More... | |
Data Fields | |
$_sock | |
$_protocol | |
$_code | |
$_reason | |
$_headers | |
$_cookies | |
$_body = '' | |
$_chunkLength = 0 | |
$_listeners = array() | |
$_toRead | |
Definition at line 1130 of file Request.php.
HTTP_Response::_decodeGzip | ( | $data | ) |
Decodes the message-body encoded by gzip.
The real decoding work is done by gzinflate() built-in function, this method only parses the header and checks data for compliance with RFC 1952
private
string | gzip-encoded data |
Definition at line 1433 of file Request.php.
References $data, HTTP_REQUEST_ERROR_GZIP_CRC, HTTP_REQUEST_ERROR_GZIP_DATA, HTTP_REQUEST_ERROR_GZIP_METHOD, HTTP_REQUEST_ERROR_GZIP_READ, and PEAR\raiseError().
HTTP_Response::_notify | ( | $event, | |
$data = null |
|||
) |
Notifies all registered listeners of an event.
string | Event name |
mixed | Additional data private |
Definition at line 1414 of file Request.php.
References $data.
HTTP_Response::_parseCookie | ( | $headervalue | ) |
Parse a Set-Cookie header to fill $_cookies array.
private
string | value of Set-Cookie header |
Definition at line 1330 of file Request.php.
HTTP_Response::_processHeader | ( | $header | ) |
Processes the response header.
private
string | HTTP header |
Definition at line 1303 of file Request.php.
HTTP_Response::_readChunked | ( | ) |
Read a part of response body encoded with chunked Transfer-Encoding.
private
Definition at line 1381 of file Request.php.
References $data.
HTTP_Response::HTTP_Response | ( | & | $sock, |
& | $listeners | ||
) |
Constructor.
Net_Socket | socket to read the response from |
array | listeners attached to request |
Definition at line 1198 of file Request.php.
HTTP_Response::process | ( | $saveBody = true , |
|
$canHaveBody = true |
|||
) |
Processes a HTTP response.
This extracts response code, headers, cookies and decodes body if it was encoded in some way
public
bool | Whether to store response body in object property, set this to false if downloading a LARGE file and using a Listener. This is assumed to be true if body is gzip-encoded. |
bool | Whether the response can actually have a message-body. Will be set to false for HEAD requests. |
PEAR_Error |
Definition at line 1220 of file Request.php.
References $data, HTTP_Request\_notify(), HTTP_REQUEST_ERROR_RESPONSE, PEAR\isError(), and PEAR\raiseError().
HTTP_Response::$_body = '' |
Definition at line 1172 of file Request.php.
HTTP_Response::$_chunkLength = 0 |
Definition at line 1178 of file Request.php.
HTTP_Response::$_code |
Definition at line 1148 of file Request.php.
HTTP_Response::$_cookies |
Definition at line 1166 of file Request.php.
HTTP_Response::$_headers |
Definition at line 1160 of file Request.php.
HTTP_Response::$_listeners = array() |
Definition at line 1184 of file Request.php.
HTTP_Response::$_protocol |
Definition at line 1142 of file Request.php.
HTTP_Response::$_reason |
Definition at line 1154 of file Request.php.
HTTP_Response::$_sock |
Definition at line 1136 of file Request.php.
HTTP_Response::$_toRead |
Definition at line 1190 of file Request.php.