| Methods |
public
|
setPassword(string $pas)
Set Password for Sudo command
Set Password for Sudo command
Parameters
|
#
|
public
|
enableStdout()
enable stdout print
|
#
|
public
|
disableStdout()
Disbale stdout print
|
#
|
public
|
createQue(
array &$ar1,
string $cmd,
string $msg = "",
boolean $sudo = false,
boolean $critical = false,
function $callbackerr = null,
)
Create Command Que
Parameters
| $ar1 |
pass by reference to fill command
|
| $cmd |
shell command
|
| $msg |
Message to display command help
|
| $sudo |
true = sudo command
|
| $critical |
true = stop execution if error in this command
|
| $callbackerr |
callback if error in this command
|
|
#
|
public
|
callSync(string $cmd, string &$str1, string $msg = "", boolean $sudo = false): boolean
Call Command and wait to finish
Call Command and wait to finish
Parameters
| $cmd |
shell command
|
| $str1 |
output text from command
|
| $msg |
help text with command
|
| $sudo |
true = run as sudo
|
Returns
|
#
|
public
|
callf(
string $cmd,
string $msg = "",
function $fun2 = null,
function $funer2 = null,
function $fun_ready2 = null,
): boolean
Call Command and process callback without wait to end.
Call Command and process callback without wait to end.
Parameters
| $cmd |
shell command
|
| $msg |
help text with command
|
| $fun2 |
callback on data
|
| $funer2 |
callback on error
|
| $fun_ready2 |
callback process ready
|
Returns
|
#
|
public
|
callSudo(
string $cmd,
string $msg = "",
function $fun2 = null,
function $funer2 = null,
function $fun_ready2 = null,
): boolean
Call Shell Command With Sudo without wait for end.
Call Shell Command With Sudo without wait for end.
Parameters
| $cmd |
command
|
| $msg |
command help text
|
| $fun2 |
callback on data
|
| $funer2 |
callback on error
|
| $fun_ready2 |
callback on process ready
|
Returns
|
#
|
public
|
calla($cmd, $msg = "", $fun = null, $funer = null, $callback_ready = null, $statuscall = null)
|
#
|
public
|
printer(string $str1)
Print Error Message on terminal
Print Error Message on terminal
Parameters
|
#
|
public
|
println(string $str1)
Print Message on terminal
Print Message on terminal
Parameters
|
#
|
public
|
processCmdQue(&$ar1)
|
#
|
public
|
processIAQue(&$ar1, $cmd, $msg1 = '', $sudo = false, $fune = null)
|
#
|
public
|
sendMsg(string $msg, string $type = 'i')
print error on console or send to browser
print error on console or send to browser
Parameters
| $type |
'i' mean info other mean error
|
Overriden by
|
#
|
public
|
execShellAsync($cmd, $callback, $funer, $callback_ready = null, $cwd = "", $env = null, $options = null)
|
#
|
public
|
removeExtraSpaces(string $v1): string
Remove Extra Spaces from text
Remove Extra Spaces from text
Parameters
|
#
|
public
|
getEvent(): string
get Gate event name trigger by browser
get Gate event name trigger by browser
|
#
|
public
|
getEventParameter(): string
get Gate event parameter post by browser
get Gate event parameter post by browser
|
#
|
public
|
onstart()
override this event handler in your Gate to handle it.
trigger when Gate start
override this event handler in your Gate to handle it.
trigger when Gate start
|
#
|
public
|
onready()
override this event handler in your Gate to handle it.
trigger when Gate finish process of default FrontFile
override this event handler in your Gate to handle it.
trigger when Gate finish process of default FrontFile
|
#
|
public
|
onfrontinit($frontobj)
override this event handler in your Gate to handle it.
trigger when Gate initialize FrontFile Object
override this event handler in your Gate to handle it.
trigger when Gate initialize FrontFile Object
|
#
|
public
|
onfrontprocess($frontobj)
override this event handler in your Gate to handle it.
trigger when Gate start process on FrontFile Object
override this event handler in your Gate to handle it.
trigger when Gate start process on FrontFile Object
|
#
|
public
|
page_delete()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser get (url=index-delete.html)…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser get (url=index-delete.html)
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_view()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser get (url=index-view-19.html)…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser get (url=index-view-19.html)
where index is Gate of Gate and Gate path is in reg.php file
view = event name
19 = recid of database table or any other value.
|
#
|
public
|
page_submit()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser post form (url=index.html)…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser post form (url=index.html)
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_insert()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser post form (url=index.html) as…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser post form (url=index.html) as new form
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_update()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser post form (url=index.html) as…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser post form (url=index.html) as filled form
from database with view_data function
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
page_new()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser get (url=index.html) first…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when browser get (url=index.html) first time
where index is Gate of Gate and Gate path is in reg.php file
|
#
|
public
|
onrun()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when Gate run after ready event and before…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when Gate run after ready event and before trigger any event handler
|
#
|
public
|
onrender()
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when Gate render after run FrontFile but…
Inbuilt Event
override this event handler in your Gate to handle it.
trigger when Gate render after run FrontFile but before start master
file process. You can't manage FrontFile output here but you can replace FrontFile
output in SphpBase::$dynData or change master file or add front place for master filepath
|
#
|
public
|
setDontExit()
Stop exit Automatically after end of processing. It turn on wait event time loop.
For exit manually then you need to…
Stop exit Automatically after end of processing. It turn on wait event time loop.
For exit manually then you need to call ExitMe
|
#
|
public
|
ExitMe()
Exit Manually
|
#
|
public
|
onwait()
Handle Wait Event when Gate is running in manually exit mode
Handle Wait Event when Gate is running in manually exit mode
Overriden by
|
#
|
public
|
setWaitInterval(int $microsec = 100000)
Set wait loop interval time
Set wait loop interval time
Parameters
| $microsec |
time in microsecond for wait loop
|
|
#
|
public
|
getAuthenticate(string $authenticates)
Set which user can access this Gate. Default user is GUEST.
You can set session variable in login Gate
SphpBase::sphp…
Set which user can access this Gate. Default user is GUEST.
You can set session variable in login Gate
SphpBase::sphp_request()->session('logType','ADMIN');
If user is not login with specific type then Gate exit and
redirect according to the getWelcome function in comp.php
Parameters
| $authenticates |
comma separated list of string. Example:- getAuthenticate("GUEST,ADMIN") or getAuthenticate("ADNIN")
|
|
#
|
public
|
setTableName(string $dbtable)
Set default table of Database to Sphp\Page object and this Gate.
This information is important for Components and other…
Set default table of Database to Sphp\Page object and this Gate.
This information is important for Components and other database users objects.
|
#
|
public
|
getTableName(): string
get default database table assigned to Gate
get default database table assigned to Gate
|
#
|
public
|
consoleWrite(string $param)
Write on Console
|
#
|
public
|
consoleWriteln(string $param)
Write on Console with end line
Write on Console with end line
|
#
|
public
|
consoleReadln(string $msg)
Read a line from Console with message print on console
Read a line from Console with message print on console
Parameters
| $msg |
message print on console
|
|
#
|
public
|
consoleError(string $err)
Write error on console
|
#
|
public
|
consoleReadArgument(string $argkey): string
Read command line argument
$v = consoleReadArgument('--dest')
Read command line argument
$v = consoleReadArgument('--dest')
Parameters
|
#
|
public
|
execute(string $command): array
Execute shell command and print output directly
Execute shell command and print output directly
Returns
return from command exit code
|
#
|
public
|
execShell(type $cmd, string &$out): boolean
Execute Shell command With output
Execute Shell command With output
Parameters
| $cmd |
Command
|
| $out |
Reference var to fill output text
|
Returns
true if execute succesfully
|
#
|
public
|
argvToArgs(): string
Convert argv to string
|
#
|
public
|
getWScript(): com
Only work on Windows, get COM object
Only work on Windows, get COM object
|
#
|
public
|
runWScript($strCommand, $intWindowStyle = 3, $bWaitOnReturn = true)
|
#
|
public
|
execInBackground(string $cmd)
Execute shell command in Background
Execute shell command in Background
|
#
|
public
|
exitApp()
Exit Gate Forcefully, Not safe
Exit Gate Forcefully, Not safe
|
#
|
protected
|
_processEvent()
Advance Function
|
#
|
protected
|
_render()
Advance Function
|
#
|