-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Steps to reproduce:
Setup test directory
cd /some/dir
composer.phar init
composer.phar require henrikbjorn/lurker dev-master
mkdir -p test/foo
touch test/foo/{bar,baz}.txt
vim test.phpSetup test script
// test.php
require_once __DIR__.'/vendor/autoload.php';
use Lurker\Event\FilesystemEvent;
use Lurker\ResourceWatcher;
$watcher = new ResourceWatcher();
$watcher->track('test.foo', __DIR__.'/test/foo');
$watcher->addListener('test.foo', function(FilesystemEvent $event) {
echo $event->getTypeString() . ' >>> ' . $event->getResource() .PHP_EOL;
});
$watcher->start();Open two terminals, t1 & t2
t1 $ php test.php
t2 $ echo "something" > test/foo/bar.txt
t1 > modify >>> [..]/test/foo/bar.txt
t2 $ mv test/foo/bar.txt test/
t1 > delete >> [..]/test/foo/bar.txt
t2 $ mv test/bar.txt test/foo/
t1 > ... # nothing !
t2 $ rm test/foo/bar.txt
t1 > ... # nothing !
t2 $ touch test/foo/bar.txt
t1 > create >> [..]/test/foo/bar.txtSame session with inotifywait
t1 $ inotifywait -rm test/foo
t2 $ echo "something" > test/foo/bar.txt
t1 > test/foo/ MODIFY bar.txt
> test/foo/ OPEN bar.txt
> test/foo/ MODIFY bar.txt
> test/foo/ CLOSE_WRITE,CLOSE bar.txt
t2 $ mv test/foo/bar.txt test/
t1 > test/foo/ MOVED_FROM bar.txt
t2 $ mv test/bar.txt test/foo/
t1 > test/foo/ MOVED_TO bar.txt
t2 $ rm test/foo/bar.txt
t1 > test/foo/ DELETE bar.txt
t2 $ touch test/foo/bar.txt
t1 > test/foo/ CREATE bar.txt
> test/foo/ OPEN bar.txt
> test/foo/ ATTRIB bar.txt
> test/foo/ CLOSE_WRITE,CLOSE bar.txtConclusion
It seems Lurker is missing two events here. IN_MOVED_FROM (FilesystemEvent::DELETE) and IN_MOVED_TO (FilesystemEvent::CREATE).
Tested with pecl-inotify 0.1.6
$ php -i | grep inotify -A 2
> inotify
>
> Version => 0.1.1Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels