Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
Google_IO_Stream Class Reference
Inheritance diagram for Google_IO_Stream:
Google_IO_Abstract

Public Member Functions

 __construct (Google_Client $client)
 
 executeRequest (Google_Http_Request $request)
 Execute an HTTP Request.
 
 getCachedRequest (Google_Http_Request $request)
 @visible for testing.
 
 getHttpResponseHeaders ($rawHeaders)
 Parse out headers from raw headers.
 
 getTimeout ()
 Get the maximum request time in seconds.
 
 makeRequest (Google_Http_Request $request)
 Execute an HTTP Request.
 
 parseHttpResponse ($respData, $headerSize)
 Used by the IO lib and also the batch processing.
 
 processEntityRequest (Google_Http_Request $request)
 @visible for testing Process an http request that contains an enclosed entity.
 
 setCachedRequest (Google_Http_Request $request)
 @visible for testing.
 
 setOptions ($options)
 Set options that update the transport implementation's behavior.
 
 setTimeout ($timeout)
 Set the maximum request time in seconds.
 
 trapError ($errno, $errstr)
 Method to handle errors, used for error handling around stream connection methods.
 

Public Attributes

const FORM_URLENCODED = 'application/x-www-form-urlencoded'
 
const TIMEOUT = "timeout"
 
const UNKNOWN_CODE = 0
 
const ZLIB = "compress.zlib://"
 

Protected Member Functions

 checkMustRevalidateCachedRequest ($cached, $request)
 Check if an already cached request must be revalidated, and if so update the request with the correct ETag headers.
 
 getHttpResponseCode ($response_headers)
 
 needsQuirk ()
 Test for the presence of a cURL header processing bug.
 
 updateCachedRequest ($cached, $responseHeaders)
 Update a cached request, using the headers from the last response.
 

Protected Attributes

Google_Client $client
 

Constructor & Destructor Documentation

◆ __construct()

Google_IO_Stream::__construct ( Google_Client $client)

Reimplemented from Google_IO_Abstract.

Member Function Documentation

◆ checkMustRevalidateCachedRequest()

Google_IO_Abstract::checkMustRevalidateCachedRequest ( $cached,
$request )
protectedinherited

Check if an already cached request must be revalidated, and if so update the request with the correct ETag headers.

Parameters
Google_Http_Request$cachedA previously cached response.
Google_Http_Request$requestThe outbound request. return bool If the cached object needs to be revalidated, false if it is still current and can be re-used.

◆ executeRequest()

Google_IO_Stream::executeRequest ( Google_Http_Request $request)

Execute an HTTP Request.

Parameters
Google_Http_Request$requestthe http request to be executed
Return values
arraycontaining response headers, body, and http code
Exceptions
Google_IO_Exceptionon curl or IO error

Reimplemented from Google_IO_Abstract.

◆ getCachedRequest()

Google_IO_Abstract::getCachedRequest ( Google_Http_Request $request)
inherited

@visible for testing.

Parameters
Google_Http_Request$request
Return values
Google_Http_Request|boolReturns the cached object or false if the operation was unsuccessful.

◆ getHttpResponseHeaders()

Google_IO_Abstract::getHttpResponseHeaders ( $rawHeaders)
inherited

Parse out headers from raw headers.

Parameters
rawHeadersarray or string
Return values
array

◆ getTimeout()

Google_IO_Stream::getTimeout ( )

Get the maximum request time in seconds.

Return values
timeoutin seconds

Reimplemented from Google_IO_Abstract.

◆ makeRequest()

Google_IO_Abstract::makeRequest ( Google_Http_Request $request)
inherited

Execute an HTTP Request.

Parameters
Google_Http_Request$requestthe http request to be executed
Return values
Google_Http_Requesthttp request with the response http code, response headers and response body filled in
Exceptions
Google_IO_Exceptionon curl or IO error

◆ needsQuirk()

Google_IO_Stream::needsQuirk ( )
protected

Test for the presence of a cURL header processing bug.

Test for the presence of a cURL header processing bug.The cURL bug was present in versions prior to 7.30.0 and caused the header length to be miscalculated when a "Connection established" header added by some proxies was present.

Return values
boolean

Return values
boolean

Reimplemented from Google_IO_Abstract.

◆ parseHttpResponse()

Google_IO_Abstract::parseHttpResponse ( $respData,
$headerSize )
inherited

Used by the IO lib and also the batch processing.

Parameters
$respData
$headerSize
Return values
array

◆ processEntityRequest()

Google_IO_Abstract::processEntityRequest ( Google_Http_Request $request)
inherited

@visible for testing Process an http request that contains an enclosed entity.

Parameters
Google_Http_Request$request
Return values
Google_Http_RequestProcessed request with the enclosed entity.

◆ setCachedRequest()

Google_IO_Abstract::setCachedRequest ( Google_Http_Request $request)
inherited

@visible for testing.

Cache the response to an HTTP request if it is cacheable.

Parameters
Google_Http_Request$request
Return values
boolReturns true if the insertion was successful. Otherwise, return false.

◆ setOptions()

Google_IO_Stream::setOptions ( $options)

Set options that update the transport implementation's behavior.

Parameters
$options

Reimplemented from Google_IO_Abstract.

◆ setTimeout()

Google_IO_Stream::setTimeout ( $timeout)

Set the maximum request time in seconds.

Parameters
$timeoutin seconds

Reimplemented from Google_IO_Abstract.

◆ updateCachedRequest()

Google_IO_Abstract::updateCachedRequest ( $cached,
$responseHeaders )
protectedinherited

Update a cached request, using the headers from the last response.

Parameters
Google_Http_Request$cachedA previously cached response.
mixedAssociative array of response headers from the last request.

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