Microsoft_Http
[ class tree: Microsoft_Http ] [ index: Microsoft_Http ] [ all elements ]

Class: Microsoft_Http_Client_Adapter_Curl

Source Location: /Http/Client/Adapter/Curl.php

Class Overview


An adapter class for Microsoft_Http_Client based on the curl extension.


Author(s):

Copyright:

  • Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)

Implements interfaces:

Variables

Methods



Class Details

[line 39]
An adapter class for Microsoft_Http_Client based on the curl extension.

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




Tags:

copyright:  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
license:  New BSD License


[ Top ]


Class Variables

$out_stream =

[line 97]

Stream for storing output



Tags:

access:  protected

Type:   resource


[ Top ]

$_config = array()

[line 46]

Parameters array



Tags:

access:  protected

Type:   array


[ Top ]

$_connected_to = array(null, null)

[line 53]

What host/port are we connected to?



Tags:

access:  protected

Type:   array


[ Top ]

$_curl =  null

[line 60]

The curl session handle



Tags:

access:  protected

Type:   resource|null


[ Top ]

$_invalidOverwritableCurlOptions = array(
        CURLOPT_HTTPGET,
        CURLOPT_POST,
        CURLOPT_PUT,
        CURLOPT_CUSTOMREQUEST,
        CURLOPT_HEADER,
        CURLOPT_RETURNTRANSFER,
        CURLOPT_HTTPHEADER,
        CURLOPT_POSTFIELDS,
        CURLOPT_INFILE,
        CURLOPT_INFILESIZE,
        CURLOPT_PORT,
        CURLOPT_MAXREDIRS,
        CURLOPT_CONNECTTIMEOUT,
        CURL_HTTP_VERSION_1_1,
        CURL_HTTP_VERSION_1_0,
    )

[line 67]

List of cURL options that should never be overwritten



Tags:

access:  protected

Type:   array


[ Top ]

$_response =  null

[line 90]

Response gotten from server



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 107]

void __construct( )

Adapter constructor

Config is set using setConfig()




Tags:

throws:  Microsoft_Http_Client_Adapter_Exception
access:  public


[ Top ]

method close [line 446]

void close( )

Close the connection to the server



Tags:

access:  public



Implementation of:
Microsoft_Http_Client_Adapter_Interface::close()
Close the connection to the server
[ Top ]

method connect [line 189]

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

Initialize curl



Tags:

throws:  Microsoft_Http_Client_Adapter_Exception if unable to connect
access:  public



Implementation of:
Microsoft_Http_Client_Adapter_Interface::connect()
Connect to the remote server

Parameters:

string   $host  
int   $port  
boolean   $secure  

[ Top ]

method getConfig [line 159]

array getConfig( )

Retrieve the array of all configuration options



Tags:

access:  public


[ Top ]

method getHandle [line 460]

resource getHandle( )

Get cUrl Handle



Tags:

access:  public


[ Top ]

method read [line 437]

string read( )

Return read response from server



Tags:

access:  public



Implementation of:
Microsoft_Http_Client_Adapter_Interface::read()
Read response from server
[ Top ]

method readHeader [line 484]

int readHeader( resource $curl, string $header)

Header reader function for CURL



Tags:

access:  public


Parameters:

resource   $curl  
string   $header  

[ Top ]

method setConfig [line 122]

Microsoft_Http_Client_Adapter_Curl setConfig( [array $config = array()])

Set the configuration array for the adapter



Tags:

throws:  Microsoft_Http_Client_Adapter_Exception
access:  public



Implementation of:
Microsoft_Http_Client_Adapter_Interface::setConfig()
Set the configuration array for the adapter

Parameters:

array   $config  

[ Top ]

method setCurlOption [line 171]

Microsoft_Http_Adapter_Curl setCurlOption( string|int $option, mixed $value)

Direct setter for cURL adapter related options.



Tags:

access:  public


Parameters:

string|int   $option  
mixed   $value  

[ Top ]

method setOutputStream [line 471]

Microsoft_Http_Client_Adapter_Socket setOutputStream( resource $stream)

Set output stream for the response



Tags:

access:  public



Implementation of:
Microsoft_Http_Client_Adapter_Stream::setOutputStream()
Set output stream

Parameters:

resource   $stream  

[ Top ]

method write [line 249]

string write( string $method, Microsoft_Uri_Http $uri, [ $httpVersion = 1.1], [array $headers = array()], [string $body = ''], float $http_ver)

Send request to the remote server



Tags:

throws:  Microsoft_Http_Client_Adapter_Exception If connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option
access:  public



Implementation of:
Microsoft_Http_Client_Adapter_Interface::write()
Send request to the remote server

Parameters:

string   $method  
Microsoft_Uri_Http   $uri  
float   $http_ver  
array   $headers  
string   $body  
   $httpVersion  

[ Top ]


Documentation generated on Wed, 18 May 2011 12:06:29 +0200 by phpDocumentor 1.4.3