function Process::restart
Restarts the process.
Be warned that the process is cloned before being started.
@final
Parameters
callable|null $callback A PHP callback to run whenever there is some: output available on STDOUT or STDERR
Throws
ProcessStartFailedException When process can't be launched
RuntimeException When process is already running
See also
start()
File
-
vendor/
symfony/ process/ Process.php, line 409
Class
- Process
- Process is a thin wrapper around proc_* functions to easily start independent PHP processes.
Namespace
Symfony\Component\ProcessCode
public function restart(?callable $callback = null, array $env = []) : static {
if ($this->isRunning()) {
throw new RuntimeException('Process is already running.');
}
$process = clone $this;
$process->start($callback, $env);
return $process;
}