Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Http_Client_Adapter_Curl Class Reference

Public Member Functions

 __construct ()
 Adapter constructor.
 
 setConfig ($config=array())
 Set the configuration array for the adapter.
 
 getConfig ()
 Retrieve the array of all configuration options.
 
 setCurlOption ($option, $value)
 Direct setter for cURL adapter related options.
 
 connect ($host, $port=80, $secure=false)
 Initialize curl.
 
 write ($method, $uri, $httpVersion=1.1, $headers=array(), $body= '')
 Send request to the remote server.
 
 read ()
 Return read response from server.
 
 close ()
 Close the connection to the server.
 
 getHandle ()
 Get cUrl Handle.
 
 setOutputStream ($stream)
 Set output stream for the response.
 
 readHeader ($curl, $header)
 Header reader function for CURL.
 

Protected Attributes

 $_config = array()
 
 $_connected_to = array(null, null)
 
 $_curl = null
 
 $_invalidOverwritableCurlOptions
 
 $_response = null
 
 $out_stream
 

Constructor & Destructor Documentation

__construct ( )

Adapter constructor.

Config is set using setConfig()

Returns
void
Exceptions
Zend_Http_Client_Adapter_Exception

Member Function Documentation

close ( )

Close the connection to the server.

Implements Zend_Http_Client_Adapter_Interface.

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

Initialize curl.

Parameters
string$host
int$port
boolean$secure
Returns
void
Exceptions
Zend_Http_Client_Adapter_Exceptionif unable to connect

Implements Zend_Http_Client_Adapter_Interface.

getConfig ( )

Retrieve the array of all configuration options.

Returns
array
getHandle ( )

Get cUrl Handle.

Returns
resource
read ( )

Return read response from server.

Returns
string

Implements Zend_Http_Client_Adapter_Interface.

readHeader (   $curl,
  $header 
)

Header reader function for CURL.

Parameters
resource$curl
string$header
Returns
int
setConfig (   $config = array())

Set the configuration array for the adapter.

Exceptions
Zend_Http_Client_Adapter_Exception
Parameters
Zend_Config  |  array$config
Returns
Zend_Http_Client_Adapter_Curl

Implements Zend_Http_Client_Adapter_Interface.

setCurlOption (   $option,
  $value 
)

Direct setter for cURL adapter related options.

Parameters
string | int$option
mixed$value
Returns
Zend_Http_Adapter_Curl
setOutputStream (   $stream)

Set output stream for the response.

Parameters
resource$stream
Returns
Zend_Http_Client_Adapter_Socket

Implements Zend_Http_Client_Adapter_Stream.

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

Send request to the remote server.

Parameters
string$method
Zend_Uri_Http$uri
float$http_ver
array$headers
string$body
Returns
string $request
Exceptions
Zend_Http_Client_Adapter_ExceptionIf connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option

Make sure POSTFIELDS is set after $curlMethod is set: http://de2.php.net/manual/en/function.curl-setopt.php#81161

Implements Zend_Http_Client_Adapter_Interface.

Member Data Documentation

$_config = array()
protected
$_connected_to = array(null, null)
protected
$_curl = null
protected
$_invalidOverwritableCurlOptions
protected
$_response = null
protected
$out_stream
protected