PHP code example of takuya / php-fsnotifywait-wrapper
1. Go to this page and download the library: Download takuya/php-fsnotifywait-wrapper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
takuya / php-fsnotifywait-wrapper example snippets
$fsnotify = new FsNotifyWrap('/etc');
$fsnotify->addObserver($observer = new FsEventObserver());
$observer->watch(function(FanEvent $ev ){
$this->queue->push($ev->getEventSource());
});
$fsnotify->listen();
$fsnotify = new FsNotifyWrap('/etc');
$fsnotify->addObserver($observer = new FsEventObserver());
$observer->addEventListener(
FsNotifyDelete:class,
fn($ev)=>dump($ev->getEventSource());
);
$fsnotify->listen();