You are here

public function PhpProcess::start in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/PhpProcess.php \Symfony\Component\Process\PhpProcess::start()

Starts the process and returns after writing the input to STDIN.

This method blocks until all STDIN data is sent to the process then it returns while the process runs in the background.

The termination of the process can be awaited with wait().

The callback receives the type of output (out or err) and some bytes from the output in real-time while writing the standard input to the process. It allows to have feedback from the independent process during execution. If there is no callback passed, the wait() method can be called with true as a second parameter then the callback will get all data occurred in (and since) the start call.

Parameters

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

Throws

RuntimeException When process can't be launched

RuntimeException When process is already running

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

Overrides Process::start

File

vendor/symfony/process/PhpProcess.php, line 57

Class

PhpProcess
PhpProcess runs a PHP script in an independent process.

Namespace

Symfony\Component\Process

Code

public function start($callback = null) {
  if (null === $this
    ->getCommandLine()) {
    throw new RuntimeException('Unable to find the PHP executable.');
  }
  parent::start($callback);
}