From 106e84914d42191744db39d8acfc43d2f98fb15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 15 Feb 2022 12:17:11 +0800 Subject: [PATCH] modify plugin name --- kiri-engine/FileListen/HotReload.php | 2 +- kiri-engine/FileListen/Inotify.php | 3 +++ kiri-engine/FileListen/Scaner.php | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index ff117182..8c053ae0 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -203,7 +203,7 @@ class HotReload extends Command */ public function trigger_reload(string $path = '') { - $this->logger->warning('change reload'); + $this->logger->warning('restart'); if (!empty($path) && str_starts_with($path, CONTROLLER_PATH)) { $pid = file_get_contents(storage('.swoole.pid')); if (!empty($pid) && Process::kill($pid, 0)) { diff --git a/kiri-engine/FileListen/Inotify.php b/kiri-engine/FileListen/Inotify.php index fe83b8ea..99b5acbc 100644 --- a/kiri-engine/FileListen/Inotify.php +++ b/kiri-engine/FileListen/Inotify.php @@ -3,6 +3,7 @@ namespace Kiri\FileListen; use Exception; +use Kiri\Error\Logger; use Swoole\Event; use Swoole\Timer; @@ -102,6 +103,8 @@ class Inotify */ public function reload($path) { + \Kiri::getDi()->get(Logger::class)->warning('file change'); + $this->process->trigger_reload($path); $this->process->int = -1; diff --git a/kiri-engine/FileListen/Scaner.php b/kiri-engine/FileListen/Scaner.php index dea659f8..f9d2c7ba 100644 --- a/kiri-engine/FileListen/Scaner.php +++ b/kiri-engine/FileListen/Scaner.php @@ -3,6 +3,7 @@ namespace Kiri\FileListen; use Exception; +use Kiri\Error\Logger; class Scaner { @@ -112,6 +113,8 @@ class Scaner { $this->isReloading = TRUE; + \Kiri::getDi()->get(Logger::class)->warning('file change'); + $this->process->trigger_reload($path); $this->loadDirs();