PHP code example of task / watch
1. Go to this page and download the library: Download task/watch 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/ */
task / watch example snippets
use Task\Plugin\WatchPlugin;
$project->inject(function ($container) {
$container['watch'] = new WatchPlugin;
});
$project->addTask('watch', ['watch', function ($watch) {
$watch->init('/tmp')
->addListener('modify', function ($event) {
# Do something
});
}]);