PHP Class Jyxo\Rpc\Client

Author: Jaroslav Hanslík
Afficher le fichier Open project: jyxo/php Class Usage Examples

Protected Properties

Свойство Type Description
$options array Parameters for creating RPC requests.
$timeout integer Time limit for communication with RPC server (seconds).
$url string Server address.

Méthodes publiques

Méthode Description
__construct ( string $url = '' ) Creates client instance and eventually sets server address.
disableProfiler ( ) : self Turns request profiler off.
enableProfiler ( ) : self Turns request profiler on.
getCurlOption ( string $key = '' ) : mixed Returns certain curl_setopt parameter or whole array of parameters if no parameter name is provided.
getOption ( string $key = '' ) : mixed Returns certain parameter or whole array of parameters if no parameter name is provided.
send ( string $method, array $params ) : mixed Sends a request and fetches a response from the server.
setCurlOption ( string $key, mixed $value ) : self Changes curl_setopt settings.
setOption ( string $key, mixed $value ) : self Changes client settings.
setTimeout ( integer $timeout ) : self Sets timeout.
setUrl ( string $url ) : self Sets server address.

Méthodes protégées

Méthode Description
process ( string $contentType, string $data ) : string Processes request data and fetches response.
profileEnd ( string $type, string $method, array $params, mixed $response ) : self Finishes profiling.
profileStart ( ) : self Starts profiling.

Method Details

__construct() public méthode

Creates client instance and eventually sets server address.
public __construct ( string $url = '' )
$url string Server address

disableProfiler() public méthode

Turns request profiler off.
public disableProfiler ( ) : self
Résultat self

enableProfiler() public méthode

Turns request profiler on.
public enableProfiler ( ) : self
Résultat self

getCurlOption() public méthode

Returns certain curl_setopt parameter or whole array of parameters if no parameter name is provided.
public getCurlOption ( string $key = '' ) : mixed
$key string Parameter name
Résultat mixed

getOption() public méthode

Returns certain parameter or whole array of parameters if no parameter name is provided.
public getOption ( string $key = '' ) : mixed
$key string Parameter name
Résultat mixed

process() protected méthode

Processes request data and fetches response.
protected process ( string $contentType, string $data ) : string
$contentType string Request content-type
$data string Request data
Résultat string

profileEnd() protected méthode

Finishes profiling.
protected profileEnd ( string $type, string $method, array $params, mixed $response ) : self
$type string Request type
$method string Method name
$params array Method parameters
$response mixed Server response
Résultat self

profileStart() protected méthode

Starts profiling.
protected profileStart ( ) : self
Résultat self

send() abstract public méthode

Sends a request and fetches a response from the server.
abstract public send ( string $method, array $params ) : mixed
$method string Method name
$params array Method parameters
Résultat mixed

setCurlOption() public méthode

Changes curl_setopt settings.
public setCurlOption ( string $key, mixed $value ) : self
$key string Parameter name
$value mixed Parameter value
Résultat self

setOption() public méthode

Changes client settings.
public setOption ( string $key, mixed $value ) : self
$key string Parameter name
$value mixed Parameter value
Résultat self

setTimeout() public méthode

Sets timeout.
public setTimeout ( integer $timeout ) : self
$timeout integer Call timeout
Résultat self

setUrl() public méthode

Sets server address.
public setUrl ( string $url ) : self
$url string Server address
Résultat self

Property Details

$options protected_oe property

Parameters for creating RPC requests.
protected array $options
Résultat array

$timeout protected_oe property

Time limit for communication with RPC server (seconds).
protected int $timeout
Résultat integer

$url protected_oe property

Server address.
protected string $url
Résultat string