Shell
class Shell
Constants
COLOR_ERROR |
|
COLOR_SUCCESS |
|
COLOR_WARNING |
|
COLOR_NOTICE |
|
ROOT_USER |
|
private COLOR_CODES |
|
CMD_OUTPUT_STANDARD |
|
CMD_OUTPUT_ERROR |
|
CMD_OUTPUT_BOTH |
|
Methods
Check if a certain command exists in Linux
No description
No description
Returns the configured process owners with their linux userinfo
Return current process owner
No description
Loads the specified module cron object and returns it
No description
Is the current process run by the root user?
No description
No description
Restart all daemons
Restarts the passed daemon
Schedules the cron to be started within the next three minutes, regardless of its regular execution time
Search for a token in the passed file and return the corresponding lines
No description
Set UID and GID according to configured WEBSERVER process owner This function will only work if the current process owner is root
No description
No description
No description
No description
No description
Details
at line 428
bool
command_exist(string $cmd)
Check if a certain command exists in Linux
at line 321
mixed
execute_cmd(string $cmd, bool $return_array = true, string $return_output = Shell::CMD_OUTPUT_STANDARD, int $error_code = null)
No description
at line 371
mixed
execute_cmd_in_background(string $cmd, bool $return_array = true, bool|string $log_file = false, bool $low_prio = true)
No description
at line 479
static array
getConfiguredProcessOwners()
Returns the configured process owners with their linux userinfo
at line 462
static string
getProcessOwner()
Return current process owner
at line 37
array
get_daemon_process_id(string $daemon_name)
No description
at line 77
SystemCron|false
get_module_cron_object(string $module)
Loads the specified module cron object and returns it
at line 253
array
get_process_id(string $process_name)
No description
at line 471
static bool
isProcessOwnedByRoot()
Is the current process run by the root user?
at line 266
bool
is_process_running(int $pid)
No description
at line 283
bool
kill_process_id(int $pid, bool $forced = false)
No description
at line 234
restart_all_daemons()
Restart all daemons
at line 204
bool
restart_daemon_process(string $daemon_name, bool $force = false)
Restarts the passed daemon
at line 129
schedule_cron(string $module, string $cron, int $schedule_time = null)
Schedules the cron to be started within the next three minutes, regardless of its regular execution time
at line 413
search(mixed $filename, mixed $grep, $context = 0)
Search for a token in the passed file and return the corresponding lines
at line 303
string
secure_shell_input(string $input)
No description
at line 509
static bool
setProcessOwner(string $userName = \XF_WEBSERVER_UID)
Set UID and GID according to configured WEBSERVER process owner This function will only work if the current process owner is root
This is important for security reasons
at line 51
array|bool
start_cron($module, $cron)
No description
at line 147
bool|mixed
start_daemon_process(string $daemon_name)
No description
at line 444
void
stdOut(string $message, string $logLevel = LOG_INFO, string $colorType = null)
No description
at line 181
bool
stop_daemon_process(string $daemon_name, bool $forced = false)
No description
at line 397
array
tail(string $filename, int $lines = 50)
No description