You are here

public function Process::getPid in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Process.php \Symfony\Component\Process\Process::getPid()

Returns the Pid (process identifier), if applicable.

Return value

int|null The process id if running, null otherwise

Throws

RuntimeException In case --enable-sigchild is activated

1 call to Process::getPid()
Process::stop in vendor/symfony/process/Process.php
Stops the process.

File

vendor/symfony/process/Process.php, line 374

Class

Process
Process is a thin wrapper around proc_* functions to easily 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(false);
  return $this
    ->isRunning() ? $this->processInformation['pid'] : null;
}