From a072a3f3fc033cc37ed9f94b56b0325fa46c3055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 12:13:53 +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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index f1a94b83..93f9e9f5 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -97,9 +97,11 @@ class Shutdown extends Component if (intval($content) < 1) { return false; } - exec('ps -eo pid', $this->_pids); - var_dump($this->_pids); - if (in_array($content, $this->_pids)) { + exec('ps -eo pid', $output); + $output = array_filter($output, function ($value) { + return intval($value); + }); + if (in_array(intval($content), $output)) { return false; } return true;