PHP Класс Jyxo\Rpc\Client

Автор: Jaroslav Hanslík
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$options array Parameters for creating RPC requests.
$timeout integer Time limit for communication with RPC server (seconds).
$url string Server address.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

disableProfiler() публичный Метод

Turns request profiler off.
public disableProfiler ( ) : self
Результат self

enableProfiler() публичный Метод

Turns request profiler on.
public enableProfiler ( ) : self
Результат self

getCurlOption() публичный Метод

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
Результат mixed

getOption() публичный Метод

Returns certain parameter or whole array of parameters if no parameter name is provided.
public getOption ( string $key = '' ) : mixed
$key string Parameter name
Результат mixed

process() защищенный Метод

Processes request data and fetches response.
protected process ( string $contentType, string $data ) : string
$contentType string Request content-type
$data string Request data
Результат string

profileEnd() защищенный Метод

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
Результат self

profileStart() защищенный Метод

Starts profiling.
protected profileStart ( ) : self
Результат self

send() абстрактный публичный Метод

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
Результат mixed

setCurlOption() публичный Метод

Changes curl_setopt settings.
public setCurlOption ( string $key, mixed $value ) : self
$key string Parameter name
$value mixed Parameter value
Результат self

setOption() публичный Метод

Changes client settings.
public setOption ( string $key, mixed $value ) : self
$key string Parameter name
$value mixed Parameter value
Результат self

setTimeout() публичный Метод

Sets timeout.
public setTimeout ( integer $timeout ) : self
$timeout integer Call timeout
Результат self

setUrl() публичный Метод

Sets server address.
public setUrl ( string $url ) : self
$url string Server address
Результат self

Описание свойств

$options защищенное свойство

Parameters for creating RPC requests.
protected array $options
Результат array

$timeout защищенное свойство

Time limit for communication with RPC server (seconds).
protected int $timeout
Результат integer

$url защищенное свойство

Server address.
protected string $url
Результат string