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:
parent
6addcdddee
commit
5124e1432a
17
Process.php
17
Process.php
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user