package
|
HttpSource
|
subpackage
|
Model.Datasource
|
Methods
Constructor
__construct(array $config = array(), \HttpSocket $Transport = null)
Checks if we can retry request
_canRetryRequest(\HttpSocketResponse $Response, integer $currentAttempt) : boolean
Arguments
$Response
\HttpSocketResponse
Response
boolean
Decodes the response based on the content type
_decode() : array
throws
|
If content type decoder not found or response is not an object
|
|
|
Response
array
Decoded response
Initialize default decoders
_initDefaultDecoders()
Save dump into log
_logDump(\HttpSocketResponse|boolean $Response) : boolean
Arguments
$Response
\HttpSocketResponse|boolean
Response
boolean
Make attempts to request
_request(array $request, integer $currentAttempt = 1) : boolean
Arguments
Response
boolean
Delay before newt request
_requestDelay(\HttpSocketResponse $Response, integer $currentAttempt)
Arguments
$Response
\HttpSocketResponse
Supplements a request array with oauth credentials
addOauth(array $request) : array
Arguments
Response
array
$request
Supplements a request array with oauth credentials
addOauthV2(array $request) : array
Arguments
Response
array
$request
Returns affected rows
getAffected() : integer|string
Gets credentials data
getCredentials() : array
Get decoder by given $contentType.
getDecoder(string $contentType) : callable
If decoder not found writes log and throw exception.
Arguments
Response
callable
Get decoders
getDecoders() : array
Returns last error
getError() : string
Returns number of rows in result
getNumRows(mixed $result) : integer|string
Arguments
Response
integer|string
Returns lst request query
getQuery() : string
Returns last Response
getResponse() : \HttpSocketResponse
Response
\HttpSocketResponse
Returns last request took time
getTook() : integer|string
Return current transport
getTransport() : \HttpSocket
Quote data
quote(mixed $data, integer $type = \PDO::PARAM_STR) : mixed
Issue the specified request and decode it on success
request(array $request = array()) : mixed
Arguments
Response
mixed
false on error, decoded response array on success
Reset state variables
reset()
Sets credentials data
setCredentials(array $credentials = array())
Add decoder for given $contentType
setDecoder(string|array $contentType, callable $callback, boolean $replace = false)
Arguments
$contentType
string|array
Content type
$callback
callable
Function used for decoding
$replace
boolean
Replace decoder if already set or not. Default false
Properties
Request error
_error : string
Request time
_took : integer|string
Affected rows
_affected : integer|string
Response object
_Response : \HttpSocketResponse
Type(s)
\HttpSocketResponse
Object for requests
_Transport : \HttpSocket
Connection config
_config : array
Credentials for request, for ex: login, password, token, etc
_credentials : array
Contains all possible decoders
_decoders : array
Last decoded response
_lastResponse : array