OMV\System\Process::__construct |
( |
| ) |
|
Constructor Example: $cmd = new ("ls -alh"); $cmd = new ("ls", "-al", "-h"); $cmd = new (array("ls", "-alh")); $cmd = new ("ls", array("-a", "-l", "-h"));
OMV\System\Process::execute |
( |
array & |
$output = NULL , |
|
|
& |
$exitStatus = NULL |
|
) |
| |
Execute the command.
- Parameters
-
output | If the output argument is present, then the specified array will be filled with every line of output from the command. |
exitStatus | If the argument is present along with the output argument, then the return status of the executed command will be written to this variable. |
- Returns
- The last line from the result of the command.
- Exceptions
-
OMV\System\Process::getCommandLine |
( |
| ) |
|
Get the command line to be executed.
- Returns
- The command line.
OMV\System\Process::setBackground |
( |
|
$background = TRUE | ) |
|
Execute the command in background. The method execute immediatelly returns in this case.
- Parameters
-
background | Set to TRUE to do execute the command in background. Defaults to TRUE. |
- Returns
- None.
OMV\System\Process::setEnv |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Set an environment variable.
- Parameters
-
name | The name of the environment variable. |
value | The value of the environment variable. |
- Returns
- None.
OMV\System\Process::setInputFromFile |
( |
|
$file | ) |
|
Accept input from a file. Set to FALSE to do not accept input from a file.
- Parameters
-
- Returns
- None.
OMV\System\Process::setQuiet |
( |
|
$quiet = TRUE | ) |
|
Do not throw an error exception if the command execution fails.
- Parameters
-
quiet | Set to TRUE to do not throw an exception. Defaults to TRUE. |
- Returns
- None.
OMV\System\Process::setRedirect1toFile |
( |
|
$file | ) |
|
Redirect STDOUT to the given file. Set to FALSE to do not redirect STDOUT to a file.
- Parameters
-
file | The file path, e.g. '/tmp/xyz'. |
- Returns
- None.
OMV\System\Process::setRedirect2to1 |
( |
| ) |
|
Redirect STDERR to STDOUT.
- Returns
- None.
OMV\System\Process::setRedirect2toFile |
( |
|
$file | ) |
|
Redirect STDERR to the given file. Set to FALSE to do not redirect STDERR to a file.
- Parameters
-
file | The file path, e.g. '/dev/null' or '&1'. |
- Returns
- None.
The documentation for this class was generated from the following file: