From 31fd26aba57827c80bb28f900a27b3c54da3e903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 4 Nov 2021 16:31:54 +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 --- ServerCommand.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ServerCommand.php b/ServerCommand.php index b7e2afd..6ff5a3b 100644 --- a/ServerCommand.php +++ b/ServerCommand.php @@ -6,12 +6,8 @@ namespace Server; use Annotation\Inject; use Exception; -use Http\Constrict\Request; -use Http\Constrict\RequestInterface; -use Http\Constrict\Response; -use Http\Constrict\ResponseInterface; +use Http\Handler\Router; use Kiri\Abstracts\Config; -use Kiri\Di\ContainerInterface; use Kiri\Events\EventProvider; use Kiri\Exception\ConfigException; use Kiri\Kiri; @@ -54,7 +50,7 @@ class ServerCommand extends Command $this->setName('sw:server') ->setDescription('server start|stop|reload|restart') ->addArgument('action', InputArgument::REQUIRED) - ->addOption('daemon', 'd', InputOption::VALUE_OPTIONAL,'is run daemonize',-1); + ->addOption('daemon', 'd', InputOption::VALUE_OPTIONAL, 'is run daemonize', -1); } @@ -110,12 +106,13 @@ class ServerCommand extends Command /** * @param $manager * @throws ConfigException + * @throws Exception */ private function generate_runtime_builder($manager): void { $this->configure_set(); -// exec(PHP_BINARY . ' ' . APP_PATH . 'kiri.php runtime:builder'); + Kiri::getDi()->get(Router::class)->read_files(); $this->eventProvider->on(OnBeforeWorkerStart::class, [di(OnServerWorker::class), 'setConfigure']); $this->eventProvider->on(OnWorkerStart::class, [di(WorkerDispatch::class), 'dispatch']);