Open Journal Systems  3.3.0
Guzzle\Http\Curl\RequestMediator Class Reference

Public Member Functions

 __construct (RequestInterface $request, $emitIo=false)
 
 progress ($downloadSize, $downloaded, $uploadSize, $uploaded, $handle=null)
 
 readRequestBody ($ch, $fd, $length)
 
 receiveResponseHeader ($curl, $header)
 
 writeResponseBody ($curl, $write)
 

Protected Attributes

 $emitIo
 
 $request
 

Detailed Description

Mediator between curl handles and request objects

Definition at line 12 of file RequestMediator.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Http\Curl\RequestMediator::__construct ( RequestInterface  $request,
  $emitIo = false 
)
Parameters
RequestInterface$requestRequest to mediate
bool$emitIoSet to true to dispatch events on input and output

Definition at line 30 of file RequestMediator.php.

References Guzzle\Http\Curl\RequestMediator\$emitIo, and Guzzle\Http\Curl\RequestMediator\$request.

Member Function Documentation

◆ progress()

Guzzle\Http\Curl\RequestMediator::progress (   $downloadSize,
  $downloaded,
  $uploadSize,
  $uploaded,
  $handle = null 
)

Received a progress notification

Parameters
int$downloadSizeTotal download size
int$downloadedAmount of bytes downloaded
int$uploadSizeTotal upload size
int$uploadedAmount of bytes uploaded
resource$handleCurlHandle object

Definition at line 94 of file RequestMediator.php.

◆ readRequestBody()

Guzzle\Http\Curl\RequestMediator::readRequestBody (   $ch,
  $fd,
  $length 
)

Read data from the request body and send it to curl

Parameters
resource$chCurl handle
resource$fdFile descriptor
int$lengthAmount of data to read
Returns
string

Definition at line 140 of file RequestMediator.php.

◆ receiveResponseHeader()

Guzzle\Http\Curl\RequestMediator::receiveResponseHeader (   $curl,
  $header 
)

Receive a response header from curl

Parameters
resource$curlCurl handle
string$headerReceived header
Returns
int

Definition at line 44 of file RequestMediator.php.

References Guzzle\Http\EntityBody\factory().

◆ writeResponseBody()

Guzzle\Http\Curl\RequestMediator::writeResponseBody (   $curl,
  $write 
)

Write data to the response body of a request

Parameters
resource$curlCurl handle
string$writeData that was received
Returns
int

Definition at line 114 of file RequestMediator.php.

Field Documentation

◆ $emitIo

bool Guzzle\Http\Curl\RequestMediator::$emitIo
protected

Whether or not to emit read/write events

Definition at line 24 of file RequestMediator.php.

Referenced by Guzzle\Http\Curl\RequestMediator\__construct().

◆ $request

RequestInterface Guzzle\Http\Curl\RequestMediator::$request
protected

Definition at line 18 of file RequestMediator.php.

Referenced by Guzzle\Http\Curl\RequestMediator\__construct().


The documentation for this class was generated from the following file: