XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
HTTP_Request2_Adapter_Curl Class Reference
Inheritance diagram for HTTP_Request2_Adapter_Curl:
HTTP_Request2_Adapter

Public Member Functions

 sendRequest (HTTP_Request2 $request)
 
 getInfo ()
 
- Public Member Functions inherited from HTTP_Request2_Adapter
 sendRequest (HTTP_Request2 $request)
 

Protected Member Functions

 createCurlHandle ()
 
 workaroundPhpBug47204 ($ch, &$headers)
 
 callbackReadBody ($ch, $fd, $length)
 
 callbackWriteHeader ($ch, $string)
 
 callbackWriteBody ($ch, $string)
 
- Protected Member Functions inherited from HTTP_Request2_Adapter
 calculateRequestLength (&$headers)
 

Static Protected Member Functions

static wrapCurlError ($ch)
 

Protected Attributes

 $response
 
 $eventSentHeaders = false
 
 $eventReceivedHeaders = false
 
 $position = 0
 
 $lastInfo
 
- Protected Attributes inherited from HTTP_Request2_Adapter
 $request
 
 $requestBody
 
 $contentLength
 

Static Protected Attributes

static $headerMap
 
static $sslContextMap
 
static $errorMap
 
- Static Protected Attributes inherited from HTTP_Request2_Adapter
static $bodyDisallowed = array('TRACE')
 
static $bodyRequired = array('POST', 'PUT')
 

Detailed Description

Definition at line 36 of file Curl.php.

Member Function Documentation

HTTP_Request2_Adapter_Curl::callbackReadBody (   $ch,
  $fd,
  $length 
)
protected

Callback function called by cURL for reading the request body

Parameters
resource$chcURL handle
resource$fdfile descriptor (not used)
integer$lengthmaximum length of data to return
Returns
string part of the request body, up to $length bytes

Definition at line 436 of file Curl.php.

HTTP_Request2_Adapter_Curl::callbackWriteBody (   $ch,
  $string 
)
protected

Callback function called by cURL for saving the response body

Parameters
resource$chcURL handle (not used)
string$stringpart of the response body
Returns
integer number of bytes saved
Exceptions
HTTP_Request2_MessageException
See Also
HTTP_Request2_Response::appendBody()

Definition at line 550 of file Curl.php.

HTTP_Request2_Adapter_Curl::callbackWriteHeader (   $ch,
  $string 
)
protected

Callback function called by cURL for saving the response headers

Parameters
resource$chcURL handle
string$stringresponse header (with trailing CRLF)
Returns
integer number of bytes saved
See Also
HTTP_Request2_Response::parseHeaderLine()

Definition at line 470 of file Curl.php.

HTTP_Request2_Adapter_Curl::createCurlHandle ( )
protected

Creates a new cURL handle and populates it with data from the request

Returns
resource a cURL handle, as created by curl_init()
Exceptions
HTTP_Request2_LogicException
HTTP_Request2_NotImplementedException

Definition at line 220 of file Curl.php.

HTTP_Request2_Adapter_Curl::getInfo ( )

Returns information about last transfer

Returns
array associative array as returned by curl_getinfo()

Definition at line 208 of file Curl.php.

HTTP_Request2_Adapter_Curl::sendRequest ( HTTP_Request2  $request)

Sends request to the remote server and returns its response

Parameters
HTTP_Request2$requestHTTP request message
Returns
HTTP_Request2_Response
Exceptions
HTTP_Request2_Exception

Definition at line 161 of file Curl.php.

HTTP_Request2_Adapter_Curl::workaroundPhpBug47204 (   $ch,
$headers 
)
protected

Workaround for PHP bug #47204 that prevents rewinding request body

The workaround consists of reading the entire request body into memory and setting it as CURLOPT_POSTFIELDS, so it isn't recommended for large file uploads, use Socket adapter instead.

Parameters
resource$chcURL handle
array&$headersRequest headers

Definition at line 400 of file Curl.php.

static HTTP_Request2_Adapter_Curl::wrapCurlError (   $ch)
staticprotected

Creates a subclass of HTTP_Request2_Exception from curl error data

Parameters
resource$chcurl handle
Returns
HTTP_Request2_Exception

Definition at line 139 of file Curl.php.

Member Data Documentation

HTTP_Request2_Adapter_Curl::$errorMap
staticprotected

Definition at line 65 of file Curl.php.

HTTP_Request2_Adapter_Curl::$eventReceivedHeaders = false
protected

Definition at line 117 of file Curl.php.

HTTP_Request2_Adapter_Curl::$eventSentHeaders = false
protected

Definition at line 111 of file Curl.php.

HTTP_Request2_Adapter_Curl::$headerMap
staticprotected
Initial value:
= array(
'accept-encoding' => CURLOPT_ENCODING,
'cookie' => CURLOPT_COOKIE,
'referer' => CURLOPT_REFERER,
'user-agent' => CURLOPT_USERAGENT
)

Definition at line 42 of file Curl.php.

HTTP_Request2_Adapter_Curl::$lastInfo
protected

Definition at line 130 of file Curl.php.

HTTP_Request2_Adapter_Curl::$position = 0
protected

Definition at line 124 of file Curl.php.

HTTP_Request2_Adapter_Curl::$response
protected

Definition at line 105 of file Curl.php.

HTTP_Request2_Adapter_Curl::$sslContextMap
staticprotected
Initial value:
= array(
'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER,
'ssl_cafile' => CURLOPT_CAINFO,
'ssl_capath' => CURLOPT_CAPATH,
'ssl_local_cert' => CURLOPT_SSLCERT,
'ssl_passphrase' => CURLOPT_SSLCERTPASSWD
)

Definition at line 53 of file Curl.php.


The documentation for this class was generated from the following file: