2017 © Pedro Peláez
 

library react-filesystem-monitor

Asynchronous filesystem monitor based on React PHP

image

tsufeki/react-filesystem-monitor

Asynchronous filesystem monitor based on React PHP

  • Monday, April 30, 2018
  • by tsufeki
  • Repository
  • 2 Watchers
  • 4 Stars
  • 339 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 25 % Grown

The README.md

React Filesystem Monitor

Asynchronous filesystem monitor based on React PHP., (*1)

Currently these implementations are available:, (*2)

  • INotifyProcessMonitor based on inotifywait command line utility, used on Linux.
  • FsWatchProcessMonitor based on fswatch, used on OSX.

All implementations' constructors take two arguments: a path to watch (file or recursively watched directory) and optional array of event to watch for (defaults to all events)., (*3)

Available events:, (*4)

  • access i.e. read
  • attribute - modification of permissions, timestamps etc.
  • close
  • create
  • delete
  • modify
  • move_from, move_to - file move, fired with source and destination path respectively. Only those for paths inside watched dir are fired.
  • open

These events pass as arguments: path which triggered it, boolean indicating whether the path is a directory, event name and monitor instance itself., (*5)

Additional events:, (*6)

  • all - fired for all events above
  • start - fired when watchers finished setting up
  • error

Please note that not all backends support all events. fswatch won't emit open and close events; also start is fired immediately after process starts instead of when setup is complete., (*7)

Example

$loop = React\EventLoop\Factory::create();

$monitor = (new ReactFilesystemMonitor\FilesystemMonitorFactory())->create('foo/bar', ['modify', 'delete']);
$monitor->on('all', function ($path, $isDir, $event, $monitor) {
    echo sprintf("%s:  %s%s\n", $event, $path, $isDir ? ' [dir]' : '');
});
$monitor->start($loop);

$loop->run();

The Versions

30/04 2018
30/04 2018
26/04 2018

dev-fswatch

dev-fswatch

Asynchronous filesystem monitor based on React PHP

  Sources   Download

MIT

The Requires

 

by Avatar tsufeki

05/04 2018
26/03 2018
06/12 2016

0.2.0

0.2.0.0

Asynchronous filesystem monitor based on React PHP

  Sources   Download

MIT

The Requires

 

by Avatar tsufeki

30/10 2016

0.1.0

0.1.0.0

Asynchronous filesystem monitor based on React PHP

  Sources   Download

MIT

The Requires

 

by Avatar tsufeki