PHP 클래스 Jyxo\Rpc\Server

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

공개 메소드들

메소드 설명
__clone ( ) Prevents from singleton cloning.
__destruct ( ) Destroys a class instance.
enableLogging ( string $filename, callable $callback = null ) : self Turns on logging.
getInstance ( ) : self Returns class instance.
process ( ) Processes a request and sends a RPC response.
registerClass ( string $class, boolean $useFullName = true ) : self Registers class public methods.
registerFunc ( string $func ) : self Registers given function.
registerMethod ( string $class, string $method, boolean $useFullName = true ) : self Registers given method of given class.

보호된 메소드들

메소드 설명
__construct ( ) Creates a class instance.
call ( string $method, array $params ) : mixed Calls a server method with given parameters.
register ( string $func ) Actually registers a function to a server method.

비공개 메소드들

메소드 설명
log ( string $method, array $params, mixed $result ) Logs a request.

메소드 상세

__clone() 최종 공개 메소드

Prevents from singleton cloning.
final public __clone ( )

__construct() 보호된 메소드

Creates a class instance.
protected __construct ( )

__destruct() 공개 메소드

Destroys a class instance.
public __destruct ( )

call() 보호된 메소드

Calls a server method with given parameters.
protected call ( string $method, array $params ) : mixed
$method string Method name
$params array Method parameters
리턴 mixed

enableLogging() 공개 메소드

Turns on logging.
public enableLogging ( string $filename, callable $callback = null ) : self
$filename string Log file path.
$callback callable Function to be called prior to logging a message.
리턴 self

getInstance() 공개 정적인 메소드

Returns class instance.
public static getInstance ( ) : self
리턴 self

process() 추상적인 공개 메소드

Processes a request and sends a RPC response.
abstract public process ( )

register() 추상적인 보호된 메소드

Actually registers a function to a server method.
abstract protected register ( string $func )
$func string Function name

registerClass() 공개 메소드

Registers class public methods.
public registerClass ( string $class, boolean $useFullName = true ) : self
$class string Class name
$useFullName boolean Register with class name
리턴 self

registerFunc() 공개 메소드

Registers given function.
public registerFunc ( string $func ) : self
$func string Function name
리턴 self

registerMethod() 공개 메소드

Method does not necessarily have to exist if __call or __callStatic method is defined.
public registerMethod ( string $class, string $method, boolean $useFullName = true ) : self
$class string Class name
$method string Function name
$useFullName boolean Register with class name
리턴 self