From 5f1eaf8239578630de4bfea1aaf6ad48affc0918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 5 Nov 2021 18:54:04 +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 --- kiri-engine/Application.php | 6 +++--- .../{FileChangeCustomProcess.php => HotReload.php} | 2 +- kiri-engine/FileListen/Inotify.php | 4 ++-- kiri-engine/FileListen/Scaner.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename kiri-engine/FileListen/{FileChangeCustomProcess.php => HotReload.php} (98%) diff --git a/kiri-engine/Application.php b/kiri-engine/Application.php index 768f221b..789ac5a4 100644 --- a/kiri-engine/Application.php +++ b/kiri-engine/Application.php @@ -20,7 +20,7 @@ use Kiri\Crontab\CrontabProviders; use Kiri\Events\OnAfterCommandExecute; use Kiri\Events\OnBeforeCommandExecute; use Kiri\Exception\NotFindClassException; -use Kiri\FileListen\FileChangeCustomProcess; +use Kiri\FileListen\HotReload; use ReflectionException; use Server\ServerProviders; use stdClass; @@ -119,7 +119,7 @@ class Application extends BaseApplication $container = Kiri::getDi(); $console = $container->get(ConsoleApplication::class); - $console->add($container->get(FileChangeCustomProcess::class)); + $console->add($container->get(HotReload::class)); } @@ -231,7 +231,7 @@ class Application extends BaseApplication private function enableFileChange(Command $class, $input, $output): void { fire(new OnBeforeCommandExecute()); - if (!($class instanceof FileChangeCustomProcess)) { + if (!($class instanceof HotReload)) { scan_directory(directory('app'), 'App'); } $class->run($input, $output); diff --git a/kiri-engine/FileListen/FileChangeCustomProcess.php b/kiri-engine/FileListen/HotReload.php similarity index 98% rename from kiri-engine/FileListen/FileChangeCustomProcess.php rename to kiri-engine/FileListen/HotReload.php index c86ab9af..ab7a2de3 100644 --- a/kiri-engine/FileListen/FileChangeCustomProcess.php +++ b/kiri-engine/FileListen/HotReload.php @@ -17,7 +17,7 @@ use Symfony\Component\Console\Output\OutputInterface; /** * */ -class FileChangeCustomProcess extends Command +class HotReload extends Command { diff --git a/kiri-engine/FileListen/Inotify.php b/kiri-engine/FileListen/Inotify.php index f13b526f..01558bc1 100644 --- a/kiri-engine/FileListen/Inotify.php +++ b/kiri-engine/FileListen/Inotify.php @@ -21,9 +21,9 @@ class Inotify /** * @param array $dirs - * @param FileChangeCustomProcess $process + * @param HotReload $process */ - public function __construct(protected array $dirs, public FileChangeCustomProcess $process) + public function __construct(protected array $dirs, public HotReload $process) { } diff --git a/kiri-engine/FileListen/Scaner.php b/kiri-engine/FileListen/Scaner.php index 524c6b55..ee83d480 100644 --- a/kiri-engine/FileListen/Scaner.php +++ b/kiri-engine/FileListen/Scaner.php @@ -11,9 +11,9 @@ class Scaner /** * @param array $dirs - * @param FileChangeCustomProcess $process + * @param HotReload $process */ - public function __construct(protected array $dirs, public FileChangeCustomProcess $process) + public function __construct(protected array $dirs, public HotReload $process) { }