From 28e7e5dc813665003d3867e8e2c42599b1b5146b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 19 Apr 2023 14:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HotReload.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/HotReload.php b/HotReload.php index b2cbc47..3fd75f4 100644 --- a/HotReload.php +++ b/HotReload.php @@ -39,6 +39,9 @@ class HotReload extends Command { $this->setName('hot:load'); parent::configure(); // TODO: Change the autogenerated stub + + Process::signal(SIGINT, fn() => $this->exit()); + Process::signal(SIGTERM, fn() => $this->exit()); } @@ -64,6 +67,16 @@ class HotReload extends Command } + /** + * @return void + * @throws Exception + */ + public function exit(): void + { + $this->stopProcess(); + } + + /** * @return void */