HTTP_Response* Response class to complement the Request class
| Variable Summary | |
|---|---|
| mixed | $_body |
| mixed | $_chunkLength |
| mixed | $_code |
| mixed | $_cookies |
| mixed | $_headers |
| mixed | $_listeners |
| mixed | $_protocol |
| mixed | $_sock |
| mixed | $_toRead |
| Method Summary | |
|---|---|
| HTTP_Response | HTTP_Response ( &$sock, &$listeners) |
| void | process ([ $saveBody = true] , [ $canHaveBody = true] ) |
| void | _decodeGzip ( $data) |
| void | _notify ( $event, [ $data = null] ) |
| void | _parseCookie ( $headervalue) |
| void | _processHeader ( $header) |
| void | _readChunked () |
* Response body * @var string
* Used by _readChunked(): remaining length of the current chunk * @var string
* Return code * @var string
* Cookies set in response * @var array
* Response headers * @var array
* Attached listeners * @var array
* Protocol * @var string
* Socket object * @var object
* Bytes left to read from message-body * @var null|int
* Constructor * * @param object Net_Socket socket to read the response from * @param array listeners attached to request * @return mixed PEAR Error on error, true otherwise
* Processes a HTTP response * * This extracts response code, headers, cookies and decodes body if it * was encoded in some way * * @access public * @param 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. * @param bool Whether the response can actually have a message-body. * Will be set to false for HEAD requests. * @throws PEAR_Error * @return mixed true on success, PEAR_Error in case of malformed response
* 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 * * @access private * @param string gzip-encoded data * @return string decoded data
* Notifies all registered listeners of an event. * * @param string Event name * @param mixed Additional data * @access private * @see HTTP_Request::_notify()
* Parse a Set-Cookie header to fill $_cookies array * * @access private * @param string value of Set-Cookie header
* Processes the response header * * @access private * @param string HTTP header
* Read a part of response body encoded with chunked Transfer-Encoding * * @access private * @return string
Documentation generated on 2009-01-06 at 01:01 by phpDocumentor 1.4.1