改进 命令处理为 pipe

This commit is contained in:
iVampireSP.com 2023-01-05 13:24:01 +08:00
parent 39fd536bae
commit 3f49a92e28
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -125,7 +125,6 @@ public function handle(): int
$this->pipeCommand($command);
} else {
// 子进程
$this->report();
}
@ -228,5 +227,17 @@ private function pipeCommand($command): void
echo $s;
}
}
// 命令结束后,关闭管道
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
// 关闭进程
proc_close($process);
}
}