public function Process::signal

Sends a posix signal to the process.

Parameters

integer $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php):

Return value

Process

Throws

LogicException In case the process is not running

RuntimeException In case --enable-sigchild is activated

RuntimeException In case of failure

1 call to Process::signal()
Process::stop in drupal/core/vendor/symfony/process/Symfony/Component/Process/Process.php
Stops the process.

File

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

Class

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

Namespace

Symfony\Component\Process

Code

public function signal($signal) {
  if (!$this
    ->isRunning()) {
    throw new LogicException('Can not send signal on a non running process.');
  }
  if ($this
    ->isSigchildEnabled()) {
    throw new RuntimeException('This PHP has been compiled with --enable-sigchild. The process can not be signaled.');
  }
  if (true !== @proc_terminate($this->process, $signal)) {
    throw new RuntimeException(sprintf('Error while sending signal `%d`.', $signal));
  }
  return $this;
}