Batch
in package
Class to handle batched requests to the Google API service.
Note that calls to Google\Http\Batch::execute()
do not clear the queued
requests. To start a new batch, be sure to create a new instance of this
class.
Table of Contents
Constants
- BATCH_PATH = 'batch'
Properties
- $batchPath : mixed
- $boundary : string
- $client : Client
- $CONNECTION_ESTABLISHED_HEADERS : mixed
- $requests : array<string|int, mixed>
- $rootUrl : mixed
Methods
- __construct() : mixed
- add() : mixed
- execute() : mixed
- parseResponse() : mixed
- parseHttpResponse() : array<string|int, mixed>
- Used by the IO lib and also the batch processing.
- parseRawHeaders() : mixed
Constants
BATCH_PATH
public
mixed
BATCH_PATH
= 'batch'
Properties
$batchPath
private
mixed
$batchPath
$boundary
private
string
$boundary
Multipart Boundary.
$client
private
Client
$client
$CONNECTION_ESTABLISHED_HEADERS
private
static mixed
$CONNECTION_ESTABLISHED_HEADERS
= array("HTTP/1.0 200 Connection established\r\n\r\n", "HTTP/1.1 200 Connection established\r\n\r\n")
$requests
private
array<string|int, mixed>
$requests
= array()
service requests to be executed.
$rootUrl
private
mixed
$rootUrl
Methods
__construct()
public
__construct(Client $client[, mixed $boundary = false ][, mixed $rootUrl = null ][, mixed $batchPath = null ]) : mixed
Parameters
- $client : Client
- $boundary : mixed = false
- $rootUrl : mixed = null
- $batchPath : mixed = null
add()
public
add(RequestInterface $request[, mixed $key = false ]) : mixed
Parameters
- $request : RequestInterface
- $key : mixed = false
execute()
public
execute() : mixed
parseResponse()
public
parseResponse(ResponseInterface $response[, mixed $classes = array() ]) : mixed
Parameters
- $response : ResponseInterface
- $classes : mixed = array()
parseHttpResponse()
Used by the IO lib and also the batch processing.
private
parseHttpResponse(mixed $respData, mixed $headerSize) : array<string|int, mixed>
Parameters
- $respData : mixed
- $headerSize : mixed
Return values
array<string|int, mixed>parseRawHeaders()
private
parseRawHeaders(mixed $rawHeaders) : mixed
Parameters
- $rawHeaders : mixed