OutputCapturingProcessRunner
extends
ProcessRunner
in
Runs external commands and captures standard output.
Table of Contents
Methods
- getErrorOutput() : string
- Gets stderr captured from the last command.
- run() : int
- Runs a command and returns its process status.
- runWithOutput() : int
- Runs a command and captures its standard output.
- supportsTty() : bool
- Checks whether TTY passthrough is available.
Methods
getErrorOutput()
Gets stderr captured from the last command.
public
getErrorOutput() : string
Return values
string —Returns the last process error output.
run()
Runs a command and returns its process status.
public
run(array<int, string> $command[, bool $tty = false ]) : int
Parameters
- $command : array<int, string>
-
The command arguments to execute.
- $tty : bool = false
-
Whether to request TTY passthrough.
Return values
int —Returns the command exit code.
runWithOutput()
Runs a command and captures its standard output.
public
runWithOutput(array<int, string> $command, string &$output) : int
Parameters
- $command : array<int, string>
-
The command arguments to execute.
- $output : string
-
The captured standard output.
Return values
int —Returns the command exit code.
supportsTty()
Checks whether TTY passthrough is available.
public
supportsTty() : bool
Return values
bool —Returns true when interactive execution can use a TTY.