From 497cd95731ef8ab585a41ecb63b63c9a1ebf57e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 4 Nov 2021 18:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kiri-engine/FileListen/FileChangeCustomProcess.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/FileChangeCustomProcess.php index 83969f86..c196fa98 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/FileChangeCustomProcess.php @@ -65,11 +65,12 @@ class FileChangeCustomProcess extends Command } $make = Barrier::make(); go(function () { - $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", + $this->source = proc_open('php', [ 0 => ["pipe", "r"], // 标准输入,子进程从此管道中读取数据 ] , $this->pipes); + fwrite($this->pipes[0], APP_PATH . "kiri.php sw:server restart"); }); go(function () { $sign = Coroutine::waitSignal(SIGTERM, -1); @@ -101,7 +102,6 @@ class FileChangeCustomProcess extends Command } - /** * 重启 * @throws Exception @@ -114,7 +114,9 @@ class FileChangeCustomProcess extends Command // STDIN, STDOUT // ], $this->pipes); - fwrite($this->pipes[0], "php " . APP_PATH . "kiri.php sw:server restart"); + fwrite($this->pipes[0], APP_PATH . "kiri.php sw:server restart"); + +// fwrite($this->pipes[0], "php " . APP_PATH . "kiri.php sw:server restart"); } }