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

Class: HTTP_Request2_Adapter_Curl

Source Location: /HTTP_Request2-0.1.0/Request2/Adapter/Curl.php

Class Overview

HTTP_Request2_Adapter
   |
   --HTTP_Request2_Adapter_Curl

Adapter for HTTP_Request2 wrapping around cURL extension


Author(s):

Version:

  • Release: 0.1.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTTP_Request2_Adapter

HTTP_Request2_Adapter::calculateRequestLength()
Calculates length of the request body, adds proper headers
HTTP_Request2_Adapter::sendRequest()
Sends request to the remote server and returns its response

Class Details

[line 59]
Adapter for HTTP_Request2 wrapping around cURL extension
  • Author: Alexey Borzov <avb@php.net>
  • Version: Release: 0.1.0
  • Todo: Support various SSL options
  • Todo: Timeout support (trivial, need to implement in Socket first)


[ Top ]


Class Variables

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

[line 65]

Mapping of header names to cURL options
  • Access: protected

Type:   array


[ Top ]

$lastInfo =

[line 95]

Information about last transfer, as returned by curl_getinfo()
  • Access: protected

Type:   array


[ Top ]

$position =  0

[line 89]

Position within request body

Type:   integer


[ Top ]

$requestHeaders =

[line 82]

Request headers, needed only for notifying the observers
  • Access: protected

Type:   string


[ Top ]

$response =

[line 76]

Response being received
  • Access: protected



[ Top ]



Method Detail

callbackReadBody   [line 254]

string callbackReadBody( resource $ch, resource $fd, integer $length)

Callback function called by cURL for reading the request body
  • Return: part of the request body, up to $length bytes
  • Access: protected

Parameters:

resource   $ch   —  cURL handle (not used)
resource   $fd   —  file descriptor (not used)
integer   $length   —  maximum length of data to return

[ Top ]

callbackWriteBody   [line 310]

integer callbackWriteBody( resource $ch, string $string)

Callback function called by cURL for saving the response body

Parameters:

resource   $ch   —  cURL handle (not used)
string   $string   —  part of the response body

[ Top ]

callbackWriteHeader   [line 285]

integer callbackWriteHeader( resource $ch, string $string)

Callback function called by cURL for saving the response headers

Parameters:

resource   $ch   —  cURL handle (not used)
string   $string   —  response header (with trailing CRLF)

[ Top ]

createCurlHandle   [line 145]

resource createCurlHandle( )

Creates a new cURL handle and populates it with data from the request
  • Return: a cURL handle, as created by curl_init()
  • Throws: HTTP_Request2_Exception
  • Access: protected

[ Top ]

getInfo   [line 134]

array getInfo( )

Returns information about last transfer
  • Return: associative array as returned by curl_getinfo()
  • Access: public

[ Top ]

sendRequest   [line 104]

HTTP_Request2_Response sendRequest( HTTP_Request2 $request)

Sends request to the remote server and returns its response
  • Throws: HTTP_Request2_Exception
  • Access: public

Overrides HTTP_Request2_Adapter::sendRequest() (Sends request to the remote server and returns its response)

Parameters:

HTTP_Request2   $request   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:26:15 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.