API Documentation

Http/Client/Adapter/Curl.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Http
subpackage
Client_Adapter
version
$Id: Curl.php 22221 2010-05-21 07:00:58Z dragonbe $
Classes
Zend_Http_Client_Adapter_Curl

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Http_Client_Adapter_Curl

Implements
Zend_Http_Client_Adapter_Interface
Zend_Http_Client_Adapter_Stream
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Http
subpackage
Client_Adapter
Properties
$_config
$_connected_to
$_curl
$_invalidOverwritableCurlOptions
$_response
$out_stream
Methods
__construct
setConfig
getConfig
setCurlOption
connect
write
read
close
getHandle
setOutputStream
readHeader

Description

An adapter class for Zend_Http_Client based on the curl extension.

Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl

Properties

$_config

array $_config = 'array'

Parameters array

Details

$_config
array
visibility
protected
default
array
final
false
static
false

$_connected_to

array $_connected_to = 'array'

What host/port are we connected to?

Details

$_connected_to
array
visibility
protected
default
array
final
false
static
false

$_curl

resource|null $_curl = 'null'

The curl session handle

Details

$_curl
resource|null
visibility
protected
default
null
final
false
static
false

$_invalidOverwritableCurlOptions

array $_invalidOverwritableCurlOptions = ''

List of cURL options that should never be overwritten

Details

$_invalidOverwritableCurlOptions
array
visibility
protected
default
final
false
static
false

$_response

string $_response = 'null'

Response gotten from server

Details

$_response
string
visibility
protected
default
null
final
false
static
false

$out_stream

resource $out_stream = ''

Stream for storing output

Details

$out_stream
resource
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( ) : void

Adapter constructor

Config is set using setConfig()

Details
visibility
public
final
false
static
false
throws

close

close( ) :

Close the connection to the server

Details
visibility
public
final
false
static
false

connect

connect( string $host, int $port = 80, boolean $secure = false ) : void

Initialize curl

Arguments
$host
string
$port
int
$secure
boolean
Details
visibility
public
final
false
static
false
throws
if unable to connect

getConfig

getConfig( ) : array

Retrieve the array of all configuration options

Output
array
Details
visibility
public
final
false
static
false

getHandle

getHandle( ) : resource

Get cUrl Handle

Output
resource
Details
visibility
public
final
false
static
false

read

read( ) : string

Return read response from server

Output
string
Details
visibility
public
final
false
static
false

readHeader

readHeader( resource $curl, string $header ) : int

Header reader function for CURL

Arguments
$curl
resource
$header
string
Output
int
Details
visibility
public
final
false
static
false

setConfig

setConfig( Zend_Config $config = array ) : Zend_Http_Client_Adapter_Curl

Set the configuration array for the adapter

Arguments
$config
Zend_Config
| array $config
Details
visibility
public
final
false
static
false
throws

setCurlOption

setCurlOption( string|int $option, mixed $value ) : Zend_Http_Adapter_Curl

Direct setter for cURL adapter related options.

Arguments
$option
stringint
$value
mixed
Output
Zend_Http_Adapter_Curl
Details
visibility
public
final
false
static
false

setOutputStream

setOutputStream( resource $stream ) : Zend_Http_Client_Adapter_Socket

Set output stream for the response

Arguments
$stream
resource
Details
visibility
public
final
false
static
false

write

write( string $method, Zend_Uri_Http $uri,  $httpVersion = 1.1, array $headers = array, string $body ) : string

Send request to the remote server

Arguments
$method
string
$uri
Zend_Uri_Http
$httpVersion
$headers
array
$body
string
Output
string
$request
Details
visibility
public
final
false
static
false
throws
If connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option
Documentation was generated by DocBlox.