PHP Class Jyxo\Rpc\Server

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

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
__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.

Private Methods

Méthode Description
log ( string $method, array $params, mixed $result ) Logs a request.

Method Details

__clone() final public méthode

Prevents from singleton cloning.
final public __clone ( )

__construct() protected méthode

Creates a class instance.
protected __construct ( )

__destruct() public méthode

Destroys a class instance.
public __destruct ( )

call() protected méthode

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

enableLogging() public méthode

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.
Résultat self

getInstance() public static méthode

Returns class instance.
public static getInstance ( ) : self
Résultat self

process() abstract public méthode

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

register() abstract protected méthode

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

registerClass() public méthode

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

registerFunc() public méthode

Registers given function.
public registerFunc ( string $func ) : self
$func string Function name
Résultat self

registerMethod() public méthode

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
Résultat self