Class Symfony\Component\Console\Helper\ProcessHelper

InheritanceSymfony\Component\Console\Helper\ProcessHelper » Symfony\Component\Console\Helper\Helper
ImplementsSymfony\Component\Console\Helper\HelperInterface

The ProcessHelper class provides helpers to run external processes.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$helperSet Symfony\Component\Console\Helper\Helper

Method Details

getName() public method

{@inheritdoc}

public void getName ( )
mustRun() public method

Runs the process.

This is identical to run() except that an exception is thrown if the process exits with a non-zero exit code.

See also run().

public Symfony\Component\Process\Process mustRun ( Symfony\Component\Console\Output\OutputInterface $output, $cmd, $error null, callable $callback null )
$output Symfony\Component\Console\Output\OutputInterface

An OutputInterface instance

$cmd string|Symfony\Component\Process\Process

An instance of Process or a command to run

$error string|null

An error message that must be displayed if something went wrong

$callback callable|null

A PHP callback to run whenever there is some

                             output available on STDOUT or STDERR
return Symfony\Component\Process\Process

The process that ran

throws Symfony\Component\Process\Exception\ProcessFailedException
run() public method

Runs an external process.

public Symfony\Component\Process\Process run ( Symfony\Component\Console\Output\OutputInterface $output, $cmd, $error null, callable $callback null, $verbosity = \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE )
$output Symfony\Component\Console\Output\OutputInterface

An OutputInterface instance

$cmd string|array|Symfony\Component\Process\Process

An instance of Process or an array of arguments to escape and run or a command to run

$error string|null

An error message that must be displayed if something went wrong

$callback callable|null

A PHP callback to run whenever there is some

                                   output available on STDOUT or STDERR
$verbosity int

The threshold for verbosity

return Symfony\Component\Process\Process

The process that ran

wrapCallback() public method

Wraps a Process callback to add debugging output.

public callable wrapCallback ( Symfony\Component\Console\Output\OutputInterface $output, Symfony\Component\Process\Process $process, callable $callback null )
$output Symfony\Component\Console\Output\OutputInterface

An OutputInterface interface

$process Symfony\Component\Process\Process

The Process

$callback callable|null

A PHP callable