From b3a5ff56aa86a004185e0236f6e2284d39a8135e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 10:48:59 +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 --- HttpServer/Shutdown.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index e774b7b5..3b412753 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -47,7 +47,7 @@ class Shutdown extends Component $master_pid = Server()->setting['pid_file'] ?? PID_PATH; if (file_exists($master_pid)) { - $this->close($master_pid); + $this->close(file_get_contents($master_pid)); } $this->closeOther(); } @@ -70,7 +70,7 @@ class Shutdown extends Component * @throws Exception * check server is running. */ - public function isRunning() + public function isRunning(): bool { $master_pid = Server()->setting['pid_file'] ?? PID_PATH; @@ -78,7 +78,7 @@ class Shutdown extends Component return false; } - return $this->pidIsExists($master_pid); + return $this->pidIsExists(file_get_contents($master_pid)); } @@ -112,7 +112,6 @@ class Shutdown extends Component return true; } foreach ($dir as $value) { - /** @var \DirectoryIterator $value */ if ($value->isDot()) continue; if (!$value->valid()) continue;