From 7facca27c1270881bcc80e25d8f2e7978467642e Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 9 Apr 2021 02:12:54 +0800 Subject: [PATCH] modify --- Console/AbstractConsole.php | 5 ++++- System/Application.php | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Console/AbstractConsole.php b/Console/AbstractConsole.php index c6b4f1f6..1b340e18 100644 --- a/Console/AbstractConsole.php +++ b/Console/AbstractConsole.php @@ -7,6 +7,7 @@ namespace Console; use Exception; use Snowflake\Abstracts\Component; use Snowflake\Abstracts\Input; +use Snowflake\Event; use Snowflake\Snowflake; /** @@ -56,7 +57,9 @@ abstract class AbstractConsole extends Component */ public function execCommand(Command $command): mixed { - return $command->onHandler($this->parameters); + fire(Event::SERVER_BEFORE_START); + + return $command->onHandler($this->parameters); } /** diff --git a/System/Application.php b/System/Application.php index fc590f3b..5faa2810 100644 --- a/System/Application.php +++ b/System/Application.php @@ -135,8 +135,6 @@ class Application extends BaseApplication public function start(Input $argv): void { try { - fire(Event::SERVER_BEFORE_START); - /** @var Console $manager */ $manager = Snowflake::app()->get('console'); $manager->register(Runtime::class);