-
-
Save colinodell/d6fd7a4cb6d9fbf8aa20154755278385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\Finder\Finder; | |
use Yosymfony\ResourceWatcher\ResourceCacheFile; | |
use Yosymfony\ResourceWatcher\ResourceWatcher; | |
require_once 'vendor/autoload.php'; | |
$finder = new Finder(); | |
$finder->files() | |
->name('*.php') | |
->depth(10) | |
->in(__DIR__); | |
$cache = new ResourceCacheFile('/tmp/foo/cache.php'); | |
$watcher = new ResourceWatcher($cache); | |
$watcher->setFinder($finder); | |
for ($i = 0; $i < 200; $i++) { | |
$watcher->findChanges(); | |
echo "$i: " . ($watcher->hasChanges() ? 'yes' : 'no') . "\n"; | |
usleep(250000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment