You are here

public function Process::run in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Process.php \Symfony\Component\Process\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.

Parameters

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

Return value

int The exit status code

Throws

RuntimeException When process can't be launched

RuntimeException When process stopped after receiving signal

LogicException In case a callback is provided and output has been disabled

1 call to Process::run()
Process::mustRun in vendor/symfony/process/Process.php
Runs the process.

File

vendor/symfony/process/Process.php, line 200

Class

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

Namespace

Symfony\Component\Process

Code

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