Monitors files for activity. More...
Public Member Functions | |
activity ($events) | |
Process inotify events. | |
add ($filename, $callback) | |
Add a new file to monitor, together with its callback. | |
cron () | |
Called by the main class to give the file monitor a chance to query inotify. | |
remove ($filename) | |
Remove a file watch. | |
Protected Attributes | |
$files | |
$inited = false | |
$inotify |
Monitors files for activity.
add | ( | $ | filename, | |
$ | callback | |||
) |
Add a new file to monitor, together with its callback.
$filename | Full path to file. | |
$callback | Callback to call when the file has been modified. |
cron | ( | ) |
Called by the main class to give the file monitor a chance to query inotify.
Can be called as often or as seldom as needed. Will only block if there is activity on the watched files.
remove | ( | $ | filename | ) |
Remove a file watch.
$filename | Watch's file name. |
$files [protected] |
Array of {log2command_file_monitor_file}s.
$inited = false [protected] |
Is the file monitor initialized?
$inotify [protected] |
inotify object.