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

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

Detailed Description

Definition at line 47 of file Socket.php.


Constructor & Destructor Documentation

Adapter constructor, currently empty. Config is set using setConfig()

Definition at line 101 of file Socket.php.

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.

Here is the call graph for this function:


Member Function Documentation

_checkSocketReadTimeout ( ) [protected]

Check if the socket has timed out - if so close connection and throw an exception

Exceptions:
Zend_Http_Client_Adapter_Exceptionwith READ_TIMEOUT code

Definition at line 503 of file Socket.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

connect ( host,
port = 80,
secure = false 
)

Connect to the remote server

Parameters:
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.

Here is the call graph for this function:

getConfig ( )

Retrieve the array of all configuration options

Returns:
array

Definition at line 132 of file Socket.php.

Get the stream context for the TCP connection to the server.

If no stream context is set, will create a default one.

Returns:
resource

Definition at line 176 of file Socket.php.

Here is the caller graph for this function:

read ( )

Read response from server

Returns:
string

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.

Here is the call graph for this function:

setConfig ( config = array())

Set the configuration array for the adapter

Parameters:
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

Parameters:
resource$stream
Returns:
Zend_Http_Client_Adapter_Socket

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.

Since:
Zend Framework 1.9
Parameters:
mixed$contextStream context or array of context options
Returns:
Zend_Http_Client_Adapter_Socket

Definition at line 150 of file Socket.php.

write ( method,
uri,
http_ver = '1.1',
headers = array(),
body = '' 
)

Send request to the remote server

Parameters:
string$method
Zend_Uri_Http$uri
string$http_ver
array$headers
string$body
Returns:
string Request as string

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.


Field Documentation

$_context = null [protected]

Definition at line 95 of file Socket.php.

$config [protected]
Initial value:
 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.


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