PHP 트레잇 PHPDaemon\DNode\DNode

저자: Vasily Zorin ([email protected])
파일 보기 프로젝트 열기: kakserpom/phpdaemon

보호된 프로퍼티들

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