26/11
2012
dev-master
9999999-dev https://github.com/gonzalo123/fswatcherPHP File System Watcher
MIT
The Requires
Wallogit.com
2017 © Pedro PelĂĄez
PHP File System Watcher
Filesystem watcher with PHP, (*1)
Actualy only works with Linux. Uses inotifywait to detect modifications and ĂvĂ©nement to manage events, (*3)
One usage example:, (*4)
<?php
include __DIR__ . '/../vendor/autoload.php';
use FsWatcher\Watcher;
use Sh\Sh;
$directoryToWatch = './';
$sh = new Sh();
$watcher = Watcher::factory($directoryToWatch);
$watcher->registerExtensionToWatch('php');
$watcher->onSave(function ($file) use ($sh) {
echo $sh->php("-l {$file}");
echo "\n";
});
$watcher->onDelete(function ($file) {
echo "DELETED: {$file}\n";
});
$watcher->onCreate(function ($file) {
echo "CREATED: {$file}\n";
});
$watcher->start();
PHP File System Watcher
MIT