You are here

public function Process::restart in Zircon Profile 8

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

Restarts the process.

Be warned that the process is cloned before being started.

Parameters

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

Return value

Process The new process

Throws

RuntimeException When process can't be launched

RuntimeException When process is already running

See also

start()

File

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

Class

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

Namespace

Symfony\Component\Process

Code

public function restart($callback = null) {
  if ($this
    ->isRunning()) {
    throw new RuntimeException('Process is already running');
  }
  $process = clone $this;
  $process
    ->start($callback);
  return $process;
}