eee
This commit is contained in:
@@ -78,7 +78,7 @@ class HotReload extends AbstractProcess
|
|||||||
$read = inotify_read($this->pipe);
|
$read = inotify_read($this->pipe);
|
||||||
|
|
||||||
foreach ($read as $item) {
|
foreach ($read as $item) {
|
||||||
$this->reWatch($this->watches[$item['wd']]);
|
$this->reWatch($this->watches[$item['mask']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->reload();
|
$this->reload();
|
||||||
@@ -122,12 +122,14 @@ class HotReload extends AbstractProcess
|
|||||||
* @param string $directory
|
* @param string $directory
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function reWatch(string $directory): void
|
public function reWatch(int $directory): void
|
||||||
{
|
{
|
||||||
if (str_ends_with($directory, '.php') === true) {
|
if (isset($this->watches[$directory])) {
|
||||||
inotify_rm_watch($this->pipe, $directory);
|
inotify_rm_watch($this->pipe, $directory);
|
||||||
|
|
||||||
inotify_add_watch($this->pipe, $directory, IN_MODIFY | IN_MOVE | IN_CREATE | IN_DELETE);
|
$wd = inotify_add_watch($this->pipe, $directory, IN_MODIFY | IN_MOVE | IN_CREATE | IN_DELETE);
|
||||||
|
|
||||||
|
$this->watches[$wd] = $directory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user