modify
This commit is contained in:
@@ -172,22 +172,12 @@ class ServerInotify implements CustomProcess
|
||||
return;
|
||||
}
|
||||
|
||||
$eventList = [IN_CREATE, IN_DELETE, IN_MODIFY, IN_MOVED_TO, IN_MOVED_FROM];
|
||||
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;
|
||||
}
|
||||
if ($ev['mask'] == IN_IGNORED) {
|
||||
continue;
|
||||
}
|
||||
if (!in_array($ev['mask'], $eventList)) {
|
||||
continue;
|
||||
}
|
||||
$fileType = strstr($ev['name'], '.');
|
||||
//非重启类型
|
||||
if ($fileType !== '.php') {
|
||||
continue;
|
||||
}
|
||||
if (str_ends_with($ev['name'], '.php')) {
|
||||
if ($this->int !== -1) {
|
||||
return;
|
||||
}
|
||||
@@ -196,6 +186,7 @@ class ServerInotify implements CustomProcess
|
||||
$this->isReloading = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
@@ -305,7 +296,7 @@ class ServerInotify implements CustomProcess
|
||||
|
||||
$files = scandir($dir);
|
||||
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;
|
||||
}
|
||||
$path = $dir . '/' . $f;
|
||||
|
||||
Reference in New Issue
Block a user