From 19006d2bc5dfcd2e20a28da733f2547b42525acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 10:46:51 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index 605dd9bd..6e332e51 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -92,7 +92,7 @@ class Shutdown extends Component return false; } $shell = 'ps -eo pid,cmd,state | grep %d | grep -v grep'; - exec(sprintf($shell, $content), $output, $code); + exec(sprintf($shell, intval($content)), $output, $code); var_dump($content, $output, $code); if (empty($output)) { return false; @@ -103,8 +103,9 @@ class Shutdown extends Component /** * @param string $path + * @return bool */ - public function directoryCheck(string $path) + public function directoryCheck(string $path): bool { $dir = new \DirectoryIterator($path); if ($dir->getSize() < 1) {