1
0
mirror of https://github.com/danog/process.git synced 2025-01-22 22:01:22 +01:00

Changed pid() and added status();

This commit is contained in:
Edoardo Biraghi 2015-09-11 15:38:51 +02:00
parent 6addcdddee
commit 5124e1432a

View File

@ -75,7 +75,6 @@ class Process {
$result->signal = $status["termsig"];
}
$result->exit = $status["exitcode"];
$this->proc = NULL;
$this->deferred->succeed($result);
foreach ($this->writeDeferreds as $deferred) {
@ -139,11 +138,7 @@ class Process {
}
public function pid() {
if (!$this->proc) {
return;
}
return \proc_get_status($this->proc)["pid"];
return $this->status()["pid"];
}
/**
@ -164,4 +159,14 @@ class Process {
return $deferred->promise();
}
/**
* @return array|null
*/
public function status() {
if ($this->proc === null) {
return null;
}
return proc_get_status($this->proc);
}
}