|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| getStream () | |
| setStream ($stream) | |
| getCleanup () | |
| setCleanup ($cleanup=true) | |
| getStreamName () | |
| setStreamName ($stream_name) | |
| __construct ($code, $headers, $body=null, $version= '1.1', $message=null) | |
| getBody () | |
| getRawBody () | |
| __destruct () | |
Static Public Member Functions | |
| static | fromStream ($response_str, $stream) |
Protected Member Functions | |
| readStream () | |
Protected Attributes | |
| $stream | |
| $stream_name | |
| $_cleanup | |
Definition at line 34 of file Stream.php.
| __construct | ( | $ | code, |
| $ | headers, | ||
| $ | body = null, |
||
| $ | version = '1.1', |
||
| $ | message = null |
||
| ) |
HTTP response constructor
In most cases, you would use Zend_Http_Response::fromString to parse an HTTP response string and create a new Zend_Http_Response object.
NOTE: The constructor no longer accepts nulls or empty values for the code and headers and will throw an exception if the passed values do not form a valid HTTP responses.
If no message is passed, the message will be guessed according to the response code.
| int | $code | Response code (200, 404, ...) |
| array | $headers | Headers array |
| string | $body | Response body |
| string | $version | HTTP version |
| string | $message | Response code as text |
| Zend_Http_Exception |
Reimplemented from Zend_Http_Response.
Definition at line 139 of file Stream.php.

| __destruct | ( | ) |
Definition at line 224 of file Stream.php.
| static fromStream | ( | $ | response_str, |
| $ | stream | ||
| ) | [static] |
Create a new Zend_Http_Response_Stream object from a string
| string | $response_str | |
| resource | $stream |
Definition at line 156 of file Stream.php.


| getBody | ( | ) |
Get the response body as string
This method returns the body of the HTTP response (the content), as it should be in it's readable version - that is, after decoding it (if it was decoded), deflating it (if it was gzip compressed), etc.
If you want to get the raw body (as transfered on wire) use $this->getRawBody() instead.
Reimplemented from Zend_Http_Response.
Definition at line 178 of file Stream.php.

| getCleanup | ( | ) |
| getRawBody | ( | ) |
Get the raw response body (as transfered "on wire") as string
If the body is encoded (with Transfer-Encoding, not content-encoding - IE "chunked" body), gzip compressed, etc. it will not be decoded.
Reimplemented from Zend_Http_Response.
Definition at line 194 of file Stream.php.

| getStream | ( | ) |
| getStreamName | ( | ) |
| readStream | ( | ) | [protected] |
Read stream content and return it as string
Function reads the remainder of the body from the stream and closes the stream.
Definition at line 209 of file Stream.php.

| setCleanup | ( | $ | cleanup = true | ) |
Set the cleanup trigger
| $cleanup | Set cleanup trigger |
Definition at line 95 of file Stream.php.
| setStream | ( | $ | stream | ) |
Set the response stream
| resourse | $stream |
Definition at line 75 of file Stream.php.

| setStreamName | ( | $ | stream_name | ) |
Set file name associated with the stream
| string | $stream_name | Name to set |
Definition at line 114 of file Stream.php.
$_cleanup [protected] |
Definition at line 57 of file Stream.php.
$stream [protected] |
Definition at line 41 of file Stream.php.
$stream_name [protected] |
Definition at line 50 of file Stream.php.