process() public static method

factory method, to produce an instance of Process
public static process ( $pid ) : Process
$pid
return Process
Example #1
0
 /**
  *
  * @return Process
  * @throws Exception
  */
 public function getProcess()
 {
     $pidInfo = $this->_getPidInfoFromFile();
     if (!$pidInfo) {
         throw new Exception('process does not exist');
     }
     if ($this->_processExists($pidInfo[0], $pidInfo[1])) {
         return Process::process($pidInfo[0]);
     }
     throw new Exception('process does not exist');
 }