Moodle  2.2.1
http://www.collinsharper.com
SimpleHttpResponse Class Reference
Inheritance diagram for SimpleHttpResponse:
Collaboration diagram for SimpleHttpResponse:

Public Member Functions

 SimpleHttpResponse (&$socket, $url, $encoding)
 _parse ($raw)
 getMethod ()
 getUrl ()
 getRequestData ()
 getSent ()
 getContent ()
 getHeaders ()
 getNewCookies ()
 _readAll (&$socket)
 _isLastPacket ($packet)

Data Fields

 $_url
 $_encoding
 $_sent
 $_content
 $_headers

Detailed Description

Definition at line 481 of file http.php.


Member Function Documentation

_isLastPacket ( packet)

Test to see if the packet from the socket is the last one.

Parameters:
string$packetChunk to interpret.
Returns:
boolean True if empty or EOF. private

Definition at line 617 of file http.php.

Here is the caller graph for this function:

_parse ( raw)

Splits up the headers and the rest of the content.

Parameters:
string$rawContent to parse. private

Definition at line 516 of file http.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_readAll ( &$  socket)

Reads the whole of the socket output into a single string.

Parameters:
SimpleSocket$socketUnread socket.
Returns:
string Raw output if successful else false. private

Definition at line 602 of file http.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Accessor for the content after the last header line.

Returns:
string All content. public

Definition at line 571 of file http.php.

Accessor for header block. The response is the combination of this and the content.

Returns:
SimpleHeaders Wrapped header block. public

Definition at line 581 of file http.php.

getMethod ( )

Original request method.

Returns:
string GET, POST or HEAD. public

Definition at line 534 of file http.php.

Accessor for any new cookies.

Returns:
array List of new cookies. public

Definition at line 590 of file http.php.

Original request data.

Returns:
mixed Sent content. public

Definition at line 552 of file http.php.

getSent ( )

Raw request that was sent down the wire.

Returns:
string Bytes actually sent. public

Definition at line 561 of file http.php.

getUrl ( )

Resource name.

Returns:
SimpleUrl Current url. public

Definition at line 543 of file http.php.

SimpleHttpResponse ( &$  socket,
url,
encoding 
)

Constructor. Reads and parses the incoming content and headers.

Parameters:
SimpleSocket$socketNetwork connection to fetch response text from.
SimpleUrl$urlResource name.
mixed$encodingRecord of content sent. public

Definition at line 497 of file http.php.

Here is the call graph for this function:


Field Documentation

$_content

Definition at line 485 of file http.php.

$_encoding

Definition at line 483 of file http.php.

$_headers

Definition at line 486 of file http.php.

$_sent

Definition at line 484 of file http.php.

$_url

Definition at line 482 of file http.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations