TYPO3  7.6
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

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.

References elseif.

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.

References HTTP_Request2_Exception\MALFORMED_RESPONSE.

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.

References Net_URL2\resolve().

createCurlHandle ( )
protected
getInfo ( )

Returns information about last transfer

Returns
array associative array as returned by curl_getinfo()

Definition at line 208 of file Curl.php.

References $lastInfo.

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.

References HTTP_Request2_Adapter\$request, $response, createCurlHandle(), HTTP_Request2\getCookieJar(), HTTP_Request2\getUrl(), HTTP_Request2_Exception\MISCONFIGURATION, and HTTP_Request2\setLastEvent().

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.

References HTTP_Request2_Adapter\$requestBody, HTTP_Request2\AUTH_DIGEST, and elseif.

Referenced by createCurlHandle().

static 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

$errorMap
staticprotected

Definition at line 65 of file Curl.php.

$eventReceivedHeaders = false
protected

Definition at line 117 of file Curl.php.

$eventSentHeaders = false
protected

Definition at line 111 of file Curl.php.

$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.

$lastInfo
protected

Definition at line 130 of file Curl.php.

Referenced by getInfo().

$position = 0
protected

Definition at line 124 of file Curl.php.

$response
protected

Definition at line 105 of file Curl.php.

Referenced by sendRequest().

$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.