PHP code example of peridot-php / peridot-watcher-plugin
1. Go to this page and download the library: Download peridot-php/peridot-watcher-plugin 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/ */
peridot-php / peridot-watcher-plugin example snippets
use Evenement\EventEmitterInterface;
use Peridot\Plugin\Watcher\WatcherPlugin;
return function(EventEmitterInterface $emitter) {
$watcher = new WatcherPlugin($emitter);
};
use Evenement\EventEmitterInterface;
use Peridot\Plugin\Watcher\WatcherPlugin;
use Peridot\Plugin\Watcher\WatcherInterface;
return function(EventEmitterInterface $emitter) {
$watcher = new WatcherPlugin($emitter);
$watcher->setEvents([WatcherInterface::CREATE_EVENT, WatcherInterface::MODIFY_EVENT]);
};
use Evenement\EventEmitterInterface;
use Peridot\Plugin\Watcher\WatcherPlugin;
return function(EventEmitterInterface $emitter) {
$watcher = new WatcherPlugin($emitter);
$watcher->track(__DIR__ . '/src');
};
use Evenement\EventEmitterInterface;
use Peridot\Plugin\Watcher\WatcherPlugin;
return function(EventEmitterInterface $emitter) {
$watcher = new WatcherPlugin($emitter);
$watcher->track(__DIR__ . '/src');
$watcher->addFileCriteria('/\.js$/');
};