Class ProcessHelper
The ProcessHelper class provides helpers to run external processes.
-
Symfony\Component\Console\Helper\Helper
implements
Symfony\Component\Console\Helper\HelperInterface
-
Symfony\Component\Console\Helper\ProcessHelper
Methods summary
public
Symfony\Component\Process\Process
|
#
run( Symfony\Component\Console\Output\OutputInterface $output, string|array|Symfony\Component\Process\Process $cmd, string|null $error = null, callable|null $callback = null, integer $verbosity = Symfony\Component\Console\Helper\OutputInterface::VERBOSITY_VERY_VERBOSE )
Runs an external process.
Runs an external process.
Parameters
- $output
- An OutputInterface instance
- $cmd
- An instance of Process or an array of arguments to escape and run or a command to run
- $error
- An error message that must be displayed if something went wrong
- $callback
A PHP callback to run whenever there is some
output available on STDOUT or STDERR
- $verbosity
- The threshold for verbosity
Returns
Symfony\Component\Process\Process The process that ran
|
public
Symfony\Component\Process\Process
|
#
mustRun( Symfony\Component\Console\Output\OutputInterface $output, string|Symfony\Component\Process\Process $cmd, string|null $error = null, callable|null $callback = null )
Runs the process.
This is identical to run() except that an exception is thrown if the process
exits with a non-zero exit code.
Parameters
- $output
- An OutputInterface instance
- $cmd
- An instance of Process or a command to run
- $error
- An error message that must be displayed if something went wrong
- $callback
A PHP callback to run whenever there is some
output available on STDOUT or STDERR
Returns
Symfony\Component\Process\Process The process that ran
Throws
Symfony\Component\Process\Exception\ProcessFailedException
See
|
public
callable
|
#
wrapCallback( Symfony\Component\Console\Output\OutputInterface $output, Symfony\Component\Process\Process $process, callable|null $callback = null )
Wraps a Process callback to add debugging output.
Wraps a Process callback to add debugging output.
Parameters
- $output
- An OutputInterface interface
- $process
- The Process
- $callback
- A PHP callable
Returns
callable
|
public
string
|
#
getName( )
Returns the canonical name of this helper.
Returns the canonical name of this helper.
Returns
string The canonical name
|