public function Process::run

Runs the process.

The callback receives the type of output (out or err) and some bytes from the output in real-time. It allows to have feedback from the independent process during execution.

The STDOUT and STDERR are also available after the process is finished via the getOutput() and getErrorOutput() methods.

@api

Parameters

callback|null $callback A PHP callback to run whenever there is some: output available on STDOUT or STDERR

Return value

integer The exit status code

Throws

RuntimeException When process can't be launch or is stopped

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Process.php, line 203

Class

Process
Process is a thin wrapper around proc_* functions to ease start independent PHP processes.

Namespace

Symfony\Component\Process

Code

public function run($callback = null) {
  $this
    ->start($callback);
  return $this
    ->wait($callback);
}