From c36abf43f6d4f4b55e076aa0ee4133e19736ac57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 19 Apr 2023 14:46:38 +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 --- ServerCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ServerCommand.php b/ServerCommand.php index db8c5a9..886539b 100644 --- a/ServerCommand.php +++ b/ServerCommand.php @@ -33,6 +33,7 @@ class ServerCommand extends Command /** * @return void + * @throws ReflectionException */ protected function configure(): void { @@ -55,13 +56,15 @@ class ServerCommand extends Command */ public function execute(InputInterface $input, OutputInterface $output): int { - return match ($input->getArgument('action')) { + $value = match ($input->getArgument('action')) { 'restart' => $this->restart($input), 'stop' => $this->stop(), 'start' => $this->start($input), default => throw new Exception('I don\'t know what I want to do.') }; + file_put_contents(storage('.swoole.pid'), 0); + return $value; }