PHP Class Basho\Riak\Api\Http

Inheritance: extends Basho\Riak\Api, implements Basho\Riak\ApiInterface
Afficher le fichier Open project: basho/riak-php-client

Protected Properties

Свойство Type Description
$connection null cURL connection handle
$headers
$path string API path
$query string Query string
$requestBody string Request body to be sent
$responseBody string Response body returned from request
$responseHeaders array Response headers returned from request
$statusCode integer HTTP Status Code from response

Méthodes publiques

Méthode Description
addHeader ( $key, $value ) Add a custom header to the request
closeConnection ( )
getConnection ( ) : resource
getPath ( ) : string
getQuery ( ) : string
getRequest ( ) : string
getResponseBody ( ) : string
getResponseHeaders ( ) : array
getStatusCode ( ) : integer
openConnection ( )
prepare ( Basho\Riak\Command $command, Node $node ) Prepare request to be sent
resetConnection ( )
responseBodyCallback ( $ch, $body ) : integer Response body callback
responseHeaderCallback ( $ch, $header ) : integer Response header callback
send ( ) : boolean

Méthodes protégées

Méthode Description
buildPath ( ) Sets the API path for the command
getResponseHeader ( $key, $default = '' )
parseResponse ( )
prepareConnection ( ) Prepare Connection
prepareRequest ( ) Prepare request
prepareRequestData ( ) Prepare request data
prepareRequestHeaders ( ) Prepares the request headers
prepareRequestMethod ( ) Prepare the request method
prepareRequestParameters ( ) Prepare request parameters
prepareRequestUrl ( ) Prepares the complete request URL

Private Methods

Méthode Description
createIndexQueryPath ( Basho\Riak\Bucket $bucket ) : string Generates the URL path for a 2i Query

Method Details

addHeader() public méthode

Add a custom header to the request
public addHeader ( $key, $value )
$key
$value

buildPath() protected méthode

Sets the API path for the command
protected buildPath ( )

closeConnection() public méthode

public closeConnection ( )

getConnection() public méthode

public getConnection ( ) : resource
Résultat resource

getPath() public méthode

public getPath ( ) : string
Résultat string

getQuery() public méthode

public getQuery ( ) : string
Résultat string

getRequest() public méthode

public getRequest ( ) : string
Résultat string

getResponseBody() public méthode

public getResponseBody ( ) : string
Résultat string

getResponseHeader() protected méthode

protected getResponseHeader ( $key, $default = '' )

getResponseHeaders() public méthode

public getResponseHeaders ( ) : array
Résultat array

getStatusCode() public méthode

public getStatusCode ( ) : integer
Résultat integer

openConnection() public méthode

public openConnection ( )

parseResponse() protected méthode

protected parseResponse ( )

prepare() public méthode

Prepare request to be sent
public prepare ( Basho\Riak\Command $command, Node $node )
$command Basho\Riak\Command
$node Basho\Riak\Node

prepareConnection() protected méthode

Sets general connection options that are used with every request
protected prepareConnection ( )

prepareRequest() protected méthode

Sets connection options that are specific to this request
protected prepareRequest ( )

prepareRequestData() protected méthode

Prepare request data
protected prepareRequestData ( )

prepareRequestHeaders() protected méthode

Prepares the request headers
protected prepareRequestHeaders ( )

prepareRequestMethod() protected méthode

Prepare the request method
protected prepareRequestMethod ( )

prepareRequestParameters() protected méthode

Prepare request parameters
protected prepareRequestParameters ( )

prepareRequestUrl() protected méthode

Prepares the complete request URL
protected prepareRequestUrl ( )

resetConnection() public méthode

public resetConnection ( )

responseBodyCallback() public méthode

Handles callback from curl when the response is received, it sets the response body as a member of the class. Has to be public for curl to be able to access it.
public responseBodyCallback ( $ch, $body ) : integer
$ch
$body
Résultat integer

responseHeaderCallback() public méthode

Handles callback from curl when the response is received, it parses the headers into an array sets them as member of the class. Has to be public for curl to be able to access it.
public responseHeaderCallback ( $ch, $header ) : integer
$ch
$header
Résultat integer

send() public méthode

public send ( ) : boolean
Résultat boolean

Property Details

$connection protected_oe property

cURL connection handle
protected null $connection
Résultat null

$headers protected_oe property

protected $headers

$path protected_oe property

API path
protected string $path
Résultat string

$query protected_oe property

Query string
protected string $query
Résultat string

$requestBody protected_oe property

Request body to be sent
protected string $requestBody
Résultat string

$responseBody protected_oe property

Response body returned from request
protected string $responseBody
Résultat string

$responseHeaders protected_oe property

Response headers returned from request
protected array $responseHeaders
Résultat array

$statusCode protected_oe property

HTTP Status Code from response
protected int $statusCode
Résultat integer