1
0
This commit is contained in:
Daniel Tartavel 2022-09-03 21:13:43 +02:00
parent 21e95ec286
commit a89cdd9b99

View File

@ -4,7 +4,7 @@
$cwfd = inotify_init();
if ($cwfd !== false)
{
$watch_descriptor = inotify_add_watch($cwfd, $configDir, IN_CLOSE_WRITE);
$watch_descriptor = inotify_add_watch($cwfd, $configDir, IN_CLOSE_WRITE | IN_MODIFY | IN_MOVE);
logger(ERROR, _("configWatchInit : Inotify retourne 'false'"), __FILE__ . ":" . __LINE__);
}
@ -23,28 +23,5 @@ function configWatchInit()
}
}
function configWach() :void
{
global $cwfd, $configDir;
if ($cwfd !== false)
{
$input = inotify_read($cwfd); // Does no block, and return false if no events are pending
if ($input !== false)
{
foreach ($input as $event)
{
logger(DEBUG, _("configWatch : inclus ") . $configDir . "/" . $event["name"], __FILE__ . ":" . __LINE__);
if (pathinfo($event["name"], PATHINFO_EXTENSION) == "php")
{
include $configDir . "/" . $event["name"];
}else
{
logger(DEBUG, _("configWatch : mauvaise extension, n'inclus pas ") . $configDir . "/" . $event["name"], __FILE__ . ":" . __LINE__);
}
}
}
}
}
?>