This commit is contained in:
as2252258@163.com
2021-07-26 02:11:12 +08:00
parent 6d49bffcfe
commit 633cd1b140
+4 -13
View File
@@ -172,22 +172,12 @@ class ServerInotify implements CustomProcess
return; return;
} }
$eventList = [IN_CREATE, IN_DELETE, IN_MODIFY, IN_MOVED_TO, IN_MOVED_FROM];
foreach ($events as $ev) { foreach ($events as $ev) {
if (empty($ev['name'])) { if (!in_array($ev['mask'], [IN_CREATE, IN_DELETE, IN_MODIFY, IN_MOVED_TO, IN_MOVED_FROM])) {
continue; continue;
} }
if ($ev['mask'] == IN_IGNORED) {
continue;
}
if (!in_array($ev['mask'], $eventList)) {
continue;
}
$fileType = strstr($ev['name'], '.');
//非重启类型 //非重启类型
if ($fileType !== '.php') { if (str_ends_with($ev['name'], '.php')) {
continue;
}
if ($this->int !== -1) { if ($this->int !== -1) {
return; return;
} }
@@ -196,6 +186,7 @@ class ServerInotify implements CustomProcess
$this->isReloading = true; $this->isReloading = true;
} }
} }
}
/** /**
* @throws Exception * @throws Exception
@@ -305,7 +296,7 @@ class ServerInotify implements CustomProcess
$files = scandir($dir); $files = scandir($dir);
foreach ($files as $f) { foreach ($files as $f) {
if ($f == '.' or $f == '..' or $f == 'runtime' or preg_match('/\.txt/', $f) or preg_match('/\.sql/', $f) or preg_match('/\.log/', $f)) { if (!is_dir($f) && !str_ends_with($f, '.php')) {
continue; continue;
} }
$path = $dir . '/' . $f; $path = $dir . '/' . $f;