public function Process::getPid

Returns the Pid (process identifier), if applicable.

Return value

integer|null The process id if running, null otherwise

Throws

RuntimeException In case --enable-sigchild is activated

File

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

Class

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

Namespace

Symfony\Component\Process

Code

public function getPid() {
  if ($this
    ->isSigchildEnabled()) {
    throw new RuntimeException('This PHP has been compiled with --enable-sigchild. The process identifier can not be retrieved.');
  }
  $this
    ->updateStatus();
  return $this
    ->isRunning() ? $this->processInformation['pid'] : null;
}