PHP Трейт PHPDaemon\DNode\DNode

Автор: Vasily Zorin ([email protected])
Показать файл Открыть проект

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

Свойство Тип Описание
$callbacks Associative array of callback functions registered by callRemote()
$cleaned Was this object cleaned up?
$counter Incremental counter of callback functions registered by callRemote()
$localMethods Associative array of local methods, set by defineLocalMethods()
$magicCallParent Should __call method call parent::__call()?
$persistentCallbacks Associative array of persistent callback functions registered by callRemote()
$persistentMode If true, callRemote() will register callbacks as persistent ones
$remoteMethods Associative array of registered remote methods (received in 'methods' call)

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

Метод Описание
__call ( string $method, array $args ) : mixed Magic __call method
callLocal ( $args ) : this Calls a local method
callRemote ( string $method, $args ) : this Calls a remote method
callRemoteArray ( string $method, array $args ) : this Calls a remote method with array of arguments
cleanup ( ) : void Swipes internal structures
ensureCallback ( &$arg ) : boolean Ensures that the variable passed by reference holds a valid callback-function If it doesn't, its value will be reset to null
exportObjectMethods ( $object ) : array Export object methods
onFinish ( ) : void Called when session is finished
onFrame ( string $data, integer $type ) : void Called when new frame is received
onHandshake ( ) : void Default onHandshake() method
onPacket ( array $pct ) : void Called when new packet is received
toJson ( mixed $m ) : this Encodes value into JSON
toJsonDebug ( mixed $m ) : void Encodes value into JSON for debugging purposes
toJsonDebugResursive ( &$m ) : void Recursion handler for toJsonDebug()

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

Метод Описание
defineLocalMethods ( array $arr = [] ) : void Defines local methods
extractCallbacks ( &$args, &$list, &$path ) : void Extracts callback functions from array of arguments
getPath ( &$m, array $path ) : mixed Finds value by materialized path
methodsMethod ( array $methods ) : void Handler of the 'methods' method
sendPacket ( array $pct ) : void Sends a packet
setPath ( &$m, array $path, mixed $val ) : void Sets value by materialized path

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

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

Magic __call method
public __call ( string $method, array $args ) : mixed
$method string Method name
$args array Arguments
Результат mixed

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

Calls a local method
public callLocal ( $args ) : this
$args Arguments
Результат this

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

Calls a remote method
public callRemote ( string $method, $args ) : this
$method string Method name
$args Arguments
Результат this

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

Calls a remote method with array of arguments
public callRemoteArray ( string $method, array $args ) : this
$method string Method name
$args array Arguments
Результат this

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

Swipes internal structures
public cleanup ( ) : void
Результат void

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

Defines local methods
protected defineLocalMethods ( array $arr = [] ) : void
$arr array Associative array of callbacks (methodName => callback)
Результат void

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

Ensures that the variable passed by reference holds a valid callback-function If it doesn't, its value will be reset to null
public static ensureCallback ( &$arg ) : boolean
Результат boolean

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

Export object methods
public static exportObjectMethods ( $object ) : array
$object
Результат array

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

Extracts callback functions from array of arguments
protected extractCallbacks ( &$args, &$list, &$path ) : void
Результат void

getPath() защищенный статический Метод

Finds value by materialized path
protected static getPath ( &$m, array $path ) : mixed
$path array
Результат mixed Value

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

Handler of the 'methods' method
protected methodsMethod ( array $methods ) : void
$methods array Associative array of methods
Результат void

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

Called when session is finished
public onFinish ( ) : void
Результат void

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

Called when new frame is received
public onFrame ( string $data, integer $type ) : void
$data string Frame's contents
$type integer Frame's type
Результат void

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

Default onHandshake() method
public onHandshake ( ) : void
Результат void

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

Called when new packet is received
public onPacket ( array $pct ) : void
$pct array Packet
Результат void

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

Sends a packet
protected sendPacket ( array $pct ) : void
$pct array Data
Результат void

setPath() защищенный статический Метод

Sets value by materialized path
protected static setPath ( &$m, array $path, mixed $val ) : void
$path array
$val mixed
Результат void

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

Encodes value into JSON
public static toJson ( mixed $m ) : this
$m mixed Value
Результат this

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

Encodes value into JSON for debugging purposes
public static toJsonDebug ( mixed $m ) : void
$m mixed Data
Результат void

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

Recursion handler for toJsonDebug()
public static toJsonDebugResursive ( &$m ) : void
Результат void

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

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

Associative array of callback functions registered by callRemote()
protected $callbacks

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

Was this object cleaned up?
protected $cleaned

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

Incremental counter of callback functions registered by callRemote()
protected $counter

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

Associative array of local methods, set by defineLocalMethods()
protected $localMethods

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

Should __call method call parent::__call()?
protected $magicCallParent

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

Associative array of persistent callback functions registered by callRemote()
protected $persistentCallbacks

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

If true, callRemote() will register callbacks as persistent ones
protected $persistentMode

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

Associative array of registered remote methods (received in 'methods' call)
protected $remoteMethods