Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
HTTP_Response Class Reference

Public Member Functions

 HTTP_Response (&$sock, &$listeners)
 
 process ($saveBody=true, $canHaveBody=true)
 
 _processHeader ($header)
 
 _parseCookie ($headervalue)
 
 _readChunked ()
 
 _notify ($event, $data=null)
 
 _decodeGzip ($data)
 

Data Fields

 $_sock
 
 $_protocol
 
 $_code
 
 $_reason
 
 $_headers
 
 $_cookies
 
 $_body = ''
 
 $_chunkLength = 0
 
 $_listeners = array()
 
 $_toRead
 

Detailed Description

Definition at line 1178 of file Request.php.

Member Function Documentation

_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

Parameters
stringgzip-encoded data
Returns
string decoded data

Definition at line 1481 of file Request.php.

_notify (   $event,
  $data = null 
)

Notifies all registered listeners of an event.

Parameters
stringEvent name
mixedAdditional data private
See Also
HTTP_Request::_notify()

Definition at line 1462 of file Request.php.

_parseCookie (   $headervalue)

Parse a Set-Cookie header to fill $_cookies array

private

Parameters
stringvalue of Set-Cookie header

Definition at line 1378 of file Request.php.

_processHeader (   $header)

Processes the response header

private

Parameters
stringHTTP header

Definition at line 1351 of file Request.php.

_readChunked ( )

Read a part of response body encoded with chunked Transfer-Encoding

private

Returns
string

Definition at line 1429 of file Request.php.

HTTP_Response ( $sock,
$listeners 
)

Constructor

Parameters
Net_Socketsocket to read the response from
arraylisteners attached to request

Definition at line 1246 of file Request.php.

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

Parameters
boolWhether 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.
boolWhether the response can actually have a message-body. Will be set to false for HEAD requests.
Exceptions
PEAR_Error
Returns
mixed true on success, PEAR_Error in case of malformed response

Definition at line 1268 of file Request.php.


The documentation for this class was generated from the following file: