Methods |
public
|
createProcess(string $exepath, array $param = [], string $childid = "mid1")
Create Child Process
Parameters
$exepath |
file path to execute as child process
|
$param |
pass command line arguments to child process
|
$childid |
Optional Give the name of child process work as id
|
|
#
|
public
|
sendMsg(type $msg, string $type = 'i')
Send Message to browser
Parameters
$type |
'i' mean info other mean error
|
Overrides
|
#
|
public
|
setupProxy(string $param)
Advance function
Setup proxy server for website
Advance function
Setup proxy server for website
|
#
|
public
|
setGlobalApp()
Configure Application as Global App Type.
Global Application has only 1 process for all requests and sessions.
It will…
Configure Application as Global App Type.
Global Application has only 1 process for all requests and sessions.
It will start on first request but it will not exit
with browser close. By default application type is multi process
that mean each session or Web Socket has 1 separate process.
|
#
|
public
|
setGlobalAppManager()
Set Manager WS Connection for Global Application. Every
Global Application has one main WS connection which started…
Set Manager WS Connection for Global Application. Every
Global Application has one main WS connection which started global App.
But this WS connection lost if browser close or reload. So if you need a
manager to control or watch global app processing then this method reassign
any connection id as a main connection. Only Work with Global app and
Web Socket connection.
|
#
|
public
|
sendAllProcess(string $rawdata = null, string $datatype = "text", string $groupctrl = "")
Send Data to main connections related to All processes of
current app or match with $groupctrl.
In case of global app…
Send Data to main connections related to All processes of
current app or match with $groupctrl.
In case of global app(Single Process App) Only one main
connection and if it is disconnected then data will not send.
If you want to send data to all connections of global app then use sendOthers
or sendAll.
Parameters
$rawdata |
Optional Default=(send JSServer), JSON String
|
$datatype |
Optional Default=text Data Type
|
$groupctrl |
Optional Default=this app, controller of app to send data
|
|
#
|
public
|
sendAllWS(string $rawdata = null, string $datatype = "text")
Easy Send Data for custom use sendToWS
Send Data to All WS Connections of Server also included current connection.
Easy Send Data for custom use sendToWS
Send Data to All WS Connections of Server also included current connection.
Parameters
$rawdata |
Optional Default=(send JSServer), JSON String
|
$datatype |
Optional Default=text Data Type
|
|
#
|
public
|
sendAll(string $rawdata = null, string $datatype = "text", string $groupctrl = "")
Send Data to All WS Connections related to app process, current controller or $groupctrl.
It works similar to…
Send Data to All WS Connections related to app process, current controller or $groupctrl.
It works similar to sendOthers but also send data to current connection.
Parameters
$rawdata |
Optional Default=(send JSServer), JSON String
|
$datatype |
Optional Default=text Data Type
|
$groupctrl |
Optional Default=this app, controller of app to send data
|
|
#
|
public
|
sendOthers(string $rawdata = null, string $datatype = "text", string $groupctrl = "")
Easy Send Data for custom use sendOthersRaw
Send Data to All Others WS Connections and leave current connection id
Easy Send Data for custom use sendOthersRaw
Send Data to All Others WS Connections and leave current connection id
Parameters
$rawdata |
Optional Default=(send JSServer), JSON String
|
$datatype |
Optional Default=text Data Type
|
$groupctrl |
Optional Default=this app, controller of app to send data
|
|
#
|
public
|
sendTo(int $conid = 0, string $rawdata = null, string $datatype = "text")
Send Data to connection id or current connection id
Send Data to connection id or current connection id
Parameters
$conid |
Optional Default=(current request)
|
$rawdata |
Optional Default=(send JSServer), JSON String
|
$datatype |
Optional Default=text Data Type
|
|
#
|
public
|
sendOthersRaw(string $rawdata = null, int $sendtype = 0, string $datatype = "text", string $groupctrl = "")
Advance for easy way use SendOthers
Send Data to All Others WS Connections and leave current connection id
Advance for easy way use SendOthers
Send Data to All Others WS Connections and leave current connection id
Parameters
$rawdata |
Optional Default=(send JSServer), JSON String
|
$sendtype |
Optional Default=0(All Processes(Only Main Connection
of process not all connections) of $groupctrl app or this app),
1(All connections of global app), 2(All WS connections)
|
$datatype |
Optional Default=text Data Type
|
$groupctrl |
Optional Default=this, controller of app to send data
|
|
#
|
public
|
sendToWS(string $rawdata = null, int $sendtype = 0, string $datatype = "text", string $groupctrl = "", int $conid = -1)
Advance
Send Data to WS Connections.
sendtype:-
0 = send data to all processes of this app or other app controller as …
Advance
Send Data to WS Connections.
sendtype:-
0 = send data to all processes of this app or other app controller as $groupctrl.
for single process app(global app), data send only to main connection
1 = send data to all connections of WS with global app this or other app controller as $groupctrl.
2 = send data to all WS connections of Server
3 = send data to connection id $conid only
Parameters
$rawdata |
Optional Default=(send JSServer), JSON String
|
$sendtype |
Optional Default=0 or 1,2,3
|
$datatype |
Optional Default=text Data Type
|
$groupctrl |
Optional controller of app to send data
|
$conid |
Optional Default=-1=all, this id will leave to send data if $sendtype=0,1 or 2
|
|
#
|
public
|
onconsole(string|array $data, string $type)
override this event handler in your application to handle it.
Event Handler for Child Process Console output
override this event handler in your application to handle it.
Event Handler for Child Process Console output
|
#
|
public
|
onrequest(array $data)
override this event handler in your application to handle it.
override this event handler in your application to handle it.
|
#
|
public
|
onquit()
override this event handler in your application to handle it.
Application Exit Handler
override this event handler in your application to handle it.
Application Exit Handler
|
#
|
public
|
oncquit()
override this event handler in your application to handle it.
Application Child process Exit Handler
override this event handler in your application to handle it.
Application Child process Exit Handler
|
#
|
public
|
onwscon(array $conobj)
override this event handler in your application to handle it.
WebSocket Connection Handler,
Connection object include…
override this event handler in your application to handle it.
WebSocket Connection Handler,
Connection object include conid, REQUEST_ADD and REQUEST_PORT key
Trigger on each new connection
Parameters
$conobj |
WS Connection Object
|
|
#
|
public
|
onwsdiscon(array $conobj)
override this event handler in your application to handle it.
WebSocket DisConnection Handler
Connection object include…
override this event handler in your application to handle it.
WebSocket DisConnection Handler
Connection object include conid, REQUEST_ADD and REQUEST_PORT key
Trigger on each connection close
Parameters
$conobj |
WS Connection Object
|
|
#
|
public
|
sendData(array|string $data, string $type = "jsonweb")
Advance Function
Send Data to Browser in JSON format
Advance Function
Send Data to Browser in JSON format
Parameters
$type |
Optional Default=jsonweb
|
|
#
|
public
|
sendCommand(string|array $msg, string $type = "childp")
Send Command to Child Process
Send Command to Child Process
Parameters
$type |
Optional Default=childp
|
|
#
|
public
|
sendProcess(string $ptype, array|string $data, string $type = "childp")
Advance Function
Send Data to Child Process
Advance Function
Send Data to Child Process
Parameters
$ptype |
Your custom command type. sendCommand use 'cmd' and callProcess use 'fun'
|
$type |
Optional Default=childp
|
|
#
|
public
|
callProcess(string $fun, string|array $data, string $type = "childp")
Call function of child process and pass data
Call function of child process and pass data
Parameters
$fun |
function name of child process
|
$type |
Optional
|
|
#
|
public
|
onwait()
Advance function, Internal use
Override wait event handler of ConsoleAPP
Advance function, Internal use
Override wait event handler of ConsoleAPP
Overrides
|
#
|
public
|
run()
Advance function, Internal use
Advance function, Internal use
Overrides
|
#
|