Property | Type | Description | |
---|---|---|---|
$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) |
Method | Description | |
---|---|---|
__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() |
Method | Description | |
---|---|---|
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 |
public callLocal ( $args ) : this | ||
$args | Arguments | |
return | this |
public callRemote ( string $method, $args ) : this | ||
$method | string | Method name |
$args | Arguments | |
return | this |
public callRemoteArray ( string $method, array $args ) : this | ||
$method | string | Method name |
$args | array | Arguments |
return | this |
protected defineLocalMethods ( array $arr = [] ) : void | ||
$arr | array | Associative array of callbacks (methodName => callback) |
return | void |
public static ensureCallback ( &$arg ) : boolean | ||
return | boolean |
public static exportObjectMethods ( $object ) : array | ||
$object | ||
return | array |
protected extractCallbacks ( &$args, &$list, &$path ) : void | ||
return | void |
protected methodsMethod ( array $methods ) : void | ||
$methods | array | Associative array of methods |
return | void |
protected sendPacket ( array $pct ) : void | ||
$pct | array | Data |
return | void |
public static toJsonDebug ( mixed $m ) : void | ||
$m | mixed | Data |
return | void |
public static toJsonDebugResursive ( &$m ) : void | ||
return | void |
protected $callbacks |
protected $counter |
protected $localMethods |
protected $magicCallParent |
protected $persistentCallbacks |
protected $persistentMode |