public function Process::restart

Restarts the process.

Be warned that the process is cloned before being started.

Parameters

callable $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 launch or is stopped

\RuntimeException When process is already running

See also

start()

File

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

Class

Process
Process is a thin wrapper around proc_* functions to ease 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;
}