Documentation

RequestMediator
in package

Mediator between curl handles and request objects

Table of Contents

Properties

$emitIo  : bool
$request  : RequestInterface

Methods

__construct()  : mixed
progress()  : mixed
Received a progress notification
readRequestBody()  : string
Read data from the request body and send it to curl
receiveResponseHeader()  : int
Receive a response header from curl
writeResponseBody()  : int
Write data to the response body of a request

Properties

$emitIo

protected bool $emitIo

Whether or not to emit read/write events

Methods

progress()

Received a progress notification

public progress(int $downloadSize, int $downloaded, int $uploadSize, int $uploaded[, resource $handle = null ]) : mixed
Parameters
$downloadSize : int

Total download size

$downloaded : int

Amount of bytes downloaded

$uploadSize : int

Total upload size

$uploaded : int

Amount of bytes uploaded

$handle : resource = null

CurlHandle object

readRequestBody()

Read data from the request body and send it to curl

public readRequestBody(resource $ch, resource $fd, int $length) : string
Parameters
$ch : resource

Curl handle

$fd : resource

File descriptor

$length : int

Amount of data to read

Return values
string

receiveResponseHeader()

Receive a response header from curl

public receiveResponseHeader(resource $curl, string $header) : int
Parameters
$curl : resource

Curl handle

$header : string

Received header

Return values
int

writeResponseBody()

Write data to the response body of a request

public writeResponseBody(resource $curl, string $write) : int
Parameters
$curl : resource

Curl handle

$write : string

Data that was received

Return values
int

        
On this page

Search results