\Guzzle\Http\CurlRequestMediator

Mediator between curl handles and request objects

Summary

Methods
Properties
Constants
__construct()
receiveResponseHeader()
progress()
writeResponseBody()
readRequestBody()
No public properties found
No constants found
No protected methods found
$request
$emitIo
N/A
No private methods found
No private properties found
N/A

Properties

$emitIo

$emitIo : boolean

Type

boolean — Whether or not to emit read/write events

Methods

__construct()

__construct(\Guzzle\Http\Message\RequestInterface  $request, boolean  $emitIo = false) 

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request to mediate

boolean $emitIo

Set to true to dispatch events on input and output

receiveResponseHeader()

receiveResponseHeader(resource  $curl, string  $header) : integer

Receive a response header from curl

Parameters

resource $curl

Curl handle

string $header

Received header

Returns

integer

progress()

progress(integer  $downloadSize, integer  $downloaded, integer  $uploadSize, integer  $uploaded, resource  $handle = null) 

Received a progress notification

Parameters

integer $downloadSize

Total download size

integer $downloaded

Amount of bytes downloaded

integer $uploadSize

Total upload size

integer $uploaded

Amount of bytes uploaded

resource $handle

CurlHandle object

writeResponseBody()

writeResponseBody(resource  $curl, string  $write) : integer

Write data to the response body of a request

Parameters

resource $curl

Curl handle

string $write

Data that was received

Returns

integer

readRequestBody()

readRequestBody(resource  $ch, resource  $fd, integer  $length) : string

Read data from the request body and send it to curl

Parameters

resource $ch

Curl handle

resource $fd

File descriptor

integer $length

Amount of data to read

Returns

string