To get the proper status for the Process, it needs to be terminated. Sometimes, this is not the case when we call proc_get_status, so this patch waits up to 1 sec to get the right information.
@@ -174,6 +174,13 @@ class Process
$this->status = proc_get_status($process);
+ $time = 0;
+ while (1 == $this->status['running'] && $time < 1000000) {
+ $time += 1000;
+ usleep(1000);
+ $this->status = proc_get_status($process);
+ }
+
proc_close($process);
if ($this->status['signaled']) {