Merge remote-tracking branch 'origin/master'
# Conflicts: # kiri-engine/FileListen/HotReload.php
This commit is contained in:
@@ -223,6 +223,7 @@ class Application extends BaseApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
@@ -240,6 +241,8 @@ class Application extends BaseApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $className
|
* @param $className
|
||||||
* @param null $abstracts
|
* @param null $abstracts
|
||||||
|
|||||||
@@ -47,12 +47,16 @@ class Inotify
|
|||||||
public function clear()
|
public function clear()
|
||||||
{
|
{
|
||||||
Event::del($this->inotify);
|
Event::del($this->inotify);
|
||||||
|
|
||||||
|
var_dump('clear event');
|
||||||
|
|
||||||
Event::exit();
|
Event::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始监听
|
* 开始监听
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function check()
|
public function check()
|
||||||
{
|
{
|
||||||
@@ -75,7 +79,10 @@ class Inotify
|
|||||||
if ($this->process->int !== -1) {
|
if ($this->process->int !== -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->process->int = @swoole_timer_after(2000, [$this, 'reload']);
|
|
||||||
|
usleep(200);
|
||||||
|
|
||||||
|
$this->reload();
|
||||||
|
|
||||||
$this->process->isReloading = true;
|
$this->process->isReloading = true;
|
||||||
}
|
}
|
||||||
@@ -151,7 +158,6 @@ class Inotify
|
|||||||
} else if (!str_ends_with($f, '.php')) {
|
} else if (!str_ends_with($f, '.php')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//检测文件类型
|
//检测文件类型
|
||||||
if (strstr($f, '.') == '.php') {
|
if (strstr($f, '.') == '.php') {
|
||||||
$wd = @inotify_add_watch($this->inotify, $path, $this->events);
|
$wd = @inotify_add_watch($this->inotify, $path, $this->events);
|
||||||
|
|||||||
Reference in New Issue
Block a user