Php library for watching for file system changes.
Supports different backends for best cross platform usage.
- watchmedo (Cross platform pything shell utility)
- fswatch (Cross-platform file change monitor with multiple backends)
- inotifywait (Linux shell utility)
- inotify (Php PECL extension)
- Polling fallback (Slow)
- Php 5.3+
Install using composer:
composer require koala-framework/file-watcher
$watcher = Kwf\FileWatcher\Watcher::create('.');
$watcher->addListener(Kwf\FileWatcher\Events::MODIFY, function($e) {
var_dump($e->filename);
});
$watcher->start();