Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Google_IO_Abstract Class Reference
Inheritance diagram for Google_IO_Abstract:
Google_IO_Curl Google_IO_Stream moodle_google_curlio

Public Member Functions

 __construct (Google_Client $client)
 
 executeRequest (Google_Http_Request $request)
 Executes a Google_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.
 

Public Attributes

const FORM_URLENCODED = 'application/x-www-form-urlencoded'
 
const UNKNOWN_CODE = 0
 

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.
 
 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
 

Member Function Documentation

◆ checkMustRevalidateCachedRequest()

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

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_Abstract::executeRequest ( Google_Http_Request $request)
abstract

Executes a Google_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 in Google_IO_Curl, Google_IO_Stream, and moodle_google_curlio.

◆ getCachedRequest()

Google_IO_Abstract::getCachedRequest ( Google_Http_Request $request)

@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)

Parse out headers from raw headers.

Parameters
rawHeadersarray or string
Return values
array

◆ getTimeout()

Google_IO_Abstract::getTimeout ( )
abstract

Get the maximum request time in seconds.

Return values
timeoutin seconds

Reimplemented in Google_IO_Curl, Google_IO_Stream, and moodle_google_curlio.

◆ makeRequest()

Google_IO_Abstract::makeRequest ( Google_Http_Request $request)

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_Abstract::needsQuirk ( )
abstractprotected

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

Reimplemented in Google_IO_Curl, and Google_IO_Stream.

◆ parseHttpResponse()

Google_IO_Abstract::parseHttpResponse ( $respData,
$headerSize )

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)

@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)

@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_Abstract::setOptions ( $options)
abstract

Set options that update the transport implementation's behavior.

Parameters
$options

Reimplemented in Google_IO_Curl, Google_IO_Stream, and moodle_google_curlio.

◆ setTimeout()

Google_IO_Abstract::setTimeout ( $timeout)
abstract

Set the maximum request time in seconds.

Parameters
$timeoutin seconds

Reimplemented in Google_IO_Curl, Google_IO_Stream, and moodle_google_curlio.

◆ updateCachedRequest()

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

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: