Property | Type | Description | |
---|---|---|---|
$application | The application object | ||
$messageCallbacks | array | Array of callbacks |
Property | Type | Description | |
---|---|---|---|
$buffer | string | The buffer of received messages | |
$isWaitingMessage | boolean | Defines if is waiting message | |
$parseMessagesBuffer | array | Array of messages in buffer | |
$waitingMessageId | integer | The id of the waitingMessage | |
$waitingMessageResult | mixed | The return of the waitingMessage |
Method | Description | |
---|---|---|
__construct ( |
The constructor | |
addMessageCallback ( integer $id, callable $callback ) : void | When the result of a message arrives, we call a callback | |
callMessageCallback ( integer $id, string | Array | Object | integer $result ) : void | Result received, time to call the message callback | |
callObjectEventListener ( integer $id, string $eventName ) : void | Fire a event on a object | |
onData ( string $data ) : void | Process Stdout handler | |
tick ( ) : void | Read the stdout pipe from Lazarus process. This function uses stream_select to be non blocking | |
waitMessage ( |
Wait a message result |
Method | Description | |
---|---|---|
jsonDecode ( string $json ) : MessageInterface | void | Decode a received message | |
parseDebug ( $message ) : void | Parse a debug message | |
parseNormal ( $message ) : void | Parse a normal message, can be a command, command result or an event | |
prepareOutput ( string $string ) : String | Construct the output string |
public __construct ( |
||
$application | ||
return | void |
protected jsonDecode ( string $json ) : MessageInterface | void | ||
$json | string | Received json message |
return | MessageInterface | void |
protected parseDebug ( $message ) : void | ||
$message | Message | |
return | void |
protected parseNormal ( $message ) : void | ||
$message | Message | |
return | void |
protected prepareOutput ( string $string ) : String | ||
$string | string | Output string |
return | String | New output string |
public waitMessage ( |
||
$stdout | Stdout Stream | |
$message | MessageInterface | Command waiting result |
return | mixed | The result |
public Application,Gui $application | ||
return |
protected string $buffer | ||
return | string |
protected bool $isWaitingMessage | ||
return | boolean |
protected array $parseMessagesBuffer | ||
return | array |
protected int $waitingMessageId | ||
return | integer |
protected mixed $waitingMessageResult | ||
return | mixed |