php-spark/plugins/com.noccy.watcher/sparkplug.php
Christopher Vagnetoft 30dfd4889b Misc fixes and improvements
* Added request logging to com.noccy.apiclient
* Added plugin com.noccy.watcher
* Added pipe command and filter support
* Fixes and stubs
2021-12-14 23:01:25 +01:00

25 lines
587 B
PHP

<?php // "name":"Watch files and act when they are changed", "author":"Noccy"
namespace SparkPlug\Com\Noccy\Watcher;
class WatcherPlug extends \SparkPlug {
private ?FileWatcher $watcher = null;
public function load()
{
register_command(new Commands\WatchCommand());
//register_command(new PdoExecCommand());
}
public function getFileWatcher(): FileWatcher
{
if (!$this->watcher) {
$this->watcher = new FileWatcher();
}
return $this->watcher;
}
}
register_plugin("com.noccy.watcher", new WatcherPlug);