PHP Класс PicoFeed\Client\Curl

Автор: Frederic Guillot
Наследование: extends PicoFeed\Client\Client
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

doRequest() публичный Метод

Do the HTTP request.
public doRequest ( ) : array
Результат array HTTP response ['body' => ..., 'status' => ..., 'headers' => ...]

passthroughBody() публичный Метод

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
Результат integer Length of the buffer

readBody() публичный Метод

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
Результат integer Length of the buffer

readHeaders() публичный Метод

cURL callback to read HTTP headers.
public readHeaders ( resource $ch, string $buffer ) : integer
$ch resource cURL handler
$buffer string Header line
Результат integer Length of the buffer