PHP Class PicoFeed\Client\Curl

Author: Frederic Guillot
Inheritance: extends PicoFeed\Client\Client
Datei anzeigen Open project: fguillot/picofeed Class Usage Examples

Public Methods

Method Description
doRequest ( ) : array Do the HTTP request.
passthroughBody ( resource $ch, string $buffer ) : integer cURL callback to passthrough the HTTP body to the client.
readBody ( resource $ch, string $buffer ) : integer cURL callback to read the HTTP body.
readHeaders ( resource $ch, string $buffer ) : integer cURL callback to read HTTP headers.

Private Methods

Method Description
executeContext ( ) Execute curl context.
handleError ( integer $errno ) Handle cURL errors (throw individual exceptions).
handleRedirection ( string $location ) : array Handle HTTP redirects
prepareAuthContext ( resource $ch ) : resource Prepare curl auth context.
prepareContext ( ) : resource Prepare curl context.
prepareDownloadMode ( resource $ch ) : resource Set write/header functions.
prepareHeaders ( ) : string[] Prepare HTTP headers.
prepareProxyContext ( resource $ch ) : resource Prepare curl proxy context.

Method Details

doRequest() public method

Do the HTTP request.
public doRequest ( ) : array
return array HTTP response ['body' => ..., 'status' => ..., 'headers' => ...]

passthroughBody() public method

If the function return -1, curl stop to read the HTTP response
public passthroughBody ( resource $ch, string $buffer ) : integer
$ch resource cURL handler
$buffer string Chunk of data
return integer Length of the buffer

readBody() public method

If the function return -1, curl stop to read the HTTP response
public readBody ( resource $ch, string $buffer ) : integer
$ch resource cURL handler
$buffer string Chunk of data
return integer Length of the buffer

readHeaders() public method

cURL callback to read HTTP headers.
public readHeaders ( resource $ch, string $buffer ) : integer
$ch resource cURL handler
$buffer string Header line
return integer Length of the buffer