-
Notifications
You must be signed in to change notification settings - Fork 34
functions_modules_cli
Initializes the CLI module. This is a semi-automatic module that provides you with the ability to process application logik defined in Task subclasses from the commandline. You may even delay them to be processed in the background later.
// sample:
php index.php clear-logs
See Task, WdfTaskModel, ClearTask, DbTask
Definition: public function cli_init()
Returns: void
Runs a PHP script with given arguments in CLI.
Note that WDF generates a temporary php.ini file with the current loaded
INI settings and uses it for the php commandline (php -c). The script
will be run in background using nohup
and stdout/stderr is redirected to current
error_log. There will be some special arguments generated and passed to the script:
-D<path_to_datafile> Path to a file containing the serialized $_SERVER vairable
-C<path_to_configfile> Path to the currently loaded WDF config.php file
-A<appname> The name of the current WDF application (see system_init).
Definition: public function cli_run_script($php_script_path, $args, $extended_data=false, $return_cmdline=false)
Returns: void|string
Parameters:
-
string $php_script_path
The script path -
array $args
All arguments -
array $extended_data
Optional additional data to pass to the process -
bool $return_cmdline
If true will not execute, but just return the commandline
INTERNAL Lists all processes.
INTERNAL Detects if script is running as root.
INTERNAL Runs a PHP process for background task processing
INTERNAL Used to check if processes are already active
INTERNAL Processes CLI arguments including doing work on detected Tasks