diff --git a/process/Monitor.php b/process/Monitor.php index 2a52eb8..92b3716 100644 --- a/process/Monitor.php +++ b/process/Monitor.php @@ -133,14 +133,13 @@ public function checkFilesChange($monitorDir): bool continue; } // check mtime - if ($lastMtime < $file->getMTime() && in_array($file->getExtension(), $this->extensions, true)) { + if (in_array($file->getExtension(), $this->extensions, true) && $lastMtime < $file->getMTime()) { $var = 0; exec('"'.PHP_BINARY . '" -l ' . $file, $out, $var); + $lastMtime = $file->getMTime(); if ($var) { - $lastMtime = $file->getMTime(); continue; } - $lastMtime = $file->getMTime(); echo $file . " update and reload\n"; // send SIGUSR1 signal to master process for reload if (DIRECTORY_SEPARATOR === '/') {