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
|
registerTemp(TempFile $tempobj)
Register TempFile with app
Register TempFile with app
|
#
|
public
|
triggerAppEvent()
Advance Function
|
#
|
public
|
setup($tempobj)
Advance Function
|
#
|
public
|
process($tempobj)
Advance Function
|
#
|
public
|
processEvent()
Advance Function
|
#
|
public
|
render()
Advance Function
|
#
|
public
|
getEvent(): string
get controller event name trigger by browser
get controller event name trigger by browser
|
#
|
public
|
getEventParameter(): string
get controller event parameter post by browser
get controller event parameter post by browser
|
#
|
public
|
onstart()
override this event handler in your application to handle it.
trigger when application start
override this event handler in your application to handle it.
trigger when application start
|
#
|
public
|
onready()
override this event handler in your application to handle it.
trigger when application finish process of default…
override this event handler in your application to handle it.
trigger when application finish process of default TempFile
|
#
|
public
|
ontempinit($tempobj)
override this event handler in your application to handle it.
trigger when application initialize TempFile Object
override this event handler in your application to handle it.
trigger when application initialize TempFile Object
|
#
|
public
|
ontempprocess($tempobj)
override this event handler in your application to handle it.
trigger when application start process on TempFile Object
override this event handler in your application to handle it.
trigger when application start process on TempFile Object
|
#
|
public
|
page_delete()
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser get (url=index-delete…
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser get (url=index-delete.html)
where index is controller of application and application path is in reg.php file
|
#
|
public
|
page_view()
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser get (url=index-view-19…
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser get (url=index-view-19.html)
where index is controller of application and application 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 application to handle it.
trigger when browser post form (url=index…
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser post form (url=index.html)
where index is controller of application and application path is in reg.php file
|
#
|
public
|
page_insert()
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser post form (url=index…
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser post form (url=index.html) as new form
where index is controller of application and application path is in reg.php file
|
#
|
public
|
page_update()
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser post form (url=index…
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser post form (url=index.html) as filled form
from database with view_data function
where index is controller of application and application path is in reg.php file
|
#
|
public
|
page_new()
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser get (url=index.html)…
Inbuilt Event
override this event handler in your application to handle it.
trigger when browser get (url=index.html) first time
where index is controller of application and application path is in reg.php file
|
#
|
public
|
onrun()
Inbuilt Event
override this event handler in your application to handle it.
trigger when application run after ready…
Inbuilt Event
override this event handler in your application to handle it.
trigger when application run after ready event and before trigger any event handler
|
#
|
public
|
onrender()
Inbuilt Event
override this event handler in your application to handle it.
trigger when application render after run…
Inbuilt Event
override this event handler in your application to handle it.
trigger when application render after run TempFile but before start master
file process. You can't manage TempFile output here but you can replace TempFile
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 application is running in manually exit mode
Handle Wait Event when application 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
|
run()
Advance Function
|
#
|
public
|
getAuthenticate(string $authenticates)
Set which user can access this application. Default user is GUEST.
You can set session variable in login app
SphpBase:…
Set which user can access this application. Default user is GUEST.
You can set session variable in login app
SphpBase::sphp_request()->session('logType','ADMIN');
If user is not login with specific type then application 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 application.
This information is important for controls and…
Set default table of Database to Sphp\Page object and this application.
This information is important for controls and other database users objects.
|
#
|
public
|
getTableName(): string
get default database table assigned to application
get default database table assigned to application
|
#
|
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 App Forcefully, Not safe
Exit App Forcefully, Not safe
|
#
|