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


Public Member Functions | |
| __construct () | |
| setConfig ($config=array()) | |
| getConfig () | |
| setStreamContext ($context) | |
| getStreamContext () | |
| connect ($host, $port=80, $secure=false) | |
| write ($method, $uri, $http_ver= '1.1', $headers=array(), $body= '') | |
| read () | |
| close () | |
| setOutputStream ($stream) | |
| __destruct () | |
Protected Member Functions | |
| _checkSocketReadTimeout () | |
Protected Attributes | |
| $socket = null | |
| $connected_to = array(null, null) | |
| $out_stream = null | |
| $config | |
| $method = null | |
| $_context = null | |
Definition at line 47 of file Socket.php.
| __construct | ( | ) |
Adapter constructor, currently empty. Config is set using setConfig()
Definition at line 101 of file Socket.php.
| __destruct | ( | ) |
Destructor: make sure the socket is disconnected
If we are in persistent TCP mode, will not close the connection
Reimplemented in Zend_Http_Client_Adapter_Proxy.
Definition at line 537 of file Socket.php.

| _checkSocketReadTimeout | ( | ) | [protected] |
Check if the socket has timed out - if so close connection and throw an exception
| Zend_Http_Client_Adapter_Exception | with READ_TIMEOUT code |
Definition at line 503 of file Socket.php.


| close | ( | ) |
Close the connection to the server
Implements Zend_Http_Client_Adapter_Interface.
Reimplemented in Zend_Http_Client_Adapter_Proxy, and Zend_Gdata_App_LoggingHttpClientAdapterSocket.
Definition at line 490 of file Socket.php.

| connect | ( | $ | host, |
| $ | port = 80, |
||
| $ | secure = false |
||
| ) |
Connect to the remote server
| string | $host | |
| int | $port | |
| boolean | $secure |
Implements Zend_Http_Client_Adapter_Interface.
Reimplemented in Zend_Http_Client_Adapter_Proxy, and Zend_Gdata_App_LoggingHttpClientAdapterSocket.
Definition at line 192 of file Socket.php.

| getConfig | ( | ) |
Retrieve the array of all configuration options
Definition at line 132 of file Socket.php.
| getStreamContext | ( | ) |
Get the stream context for the TCP connection to the server.
If no stream context is set, will create a default one.
Definition at line 176 of file Socket.php.

| read | ( | ) |
Read response from server
Responses to HEAD requests and 204 or 304 responses are not expected to have a body - stop reading here
Implements Zend_Http_Client_Adapter_Interface.
Reimplemented in Zend_Gdata_App_LoggingHttpClientAdapterSocket.
Definition at line 315 of file Socket.php.

Set the configuration array for the adapter
| Zend_Config | | array $config |
Implements Zend_Http_Client_Adapter_Interface.
Definition at line 110 of file Socket.php.
| setOutputStream | ( | $ | stream | ) |
Set output stream for the response
| resource | $stream |
Implements Zend_Http_Client_Adapter_Stream.
Definition at line 525 of file Socket.php.
| setStreamContext | ( | $ | context | ) |
Set the stream context for the TCP connection to the server
Can accept either a pre-existing stream context resource, or an array of stream options, similar to the options array passed to the stream_context_create() PHP function. In such case a new stream context will be created using the passed options.
| mixed | $context | Stream context or array of context options |
Definition at line 150 of file Socket.php.
Send request to the remote server
| string | $method | |
| Zend_Uri_Http | $uri | |
| string | $http_ver | |
| array | $headers | |
| string | $body |
Implements Zend_Http_Client_Adapter_Interface.
Reimplemented in Zend_Http_Client_Adapter_Proxy, Zend_Gdata_App_LoggingHttpClientAdapterSocket, Zend_Gdata_HttpAdapterStreamingSocket, and Zend_Gdata_HttpAdapterStreamingProxy.
Definition at line 260 of file Socket.php.
$_context = null [protected] |
Definition at line 95 of file Socket.php.
$config [protected] |
array( 'persistent' => false, 'ssltransport' => 'ssl', 'sslcert' => null, 'sslpassphrase' => null, 'sslusecontext' => false )
Reimplemented in Zend_Http_Client_Adapter_Proxy.
Definition at line 75 of file Socket.php.
$connected_to = array(null, null) [protected] |
Definition at line 61 of file Socket.php.
$method = null [protected] |
Definition at line 88 of file Socket.php.
$out_stream = null [protected] |
Definition at line 68 of file Socket.php.
$socket = null [protected] |
Definition at line 54 of file Socket.php.