PHP 클래스 Jyxo\Rpc\Client

저자: Jaroslav Hanslík
파일 보기 프로젝트 열기: jyxo/php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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