Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Process.php

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\Process

Code

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;
}
RSS feed
Powered by Drupal