2017-25 © Pedro Pelåez
 

library react-inotify

Inotify bindings for ReactPHP

image

mkraemer/react-inotify

Inotify bindings for ReactPHP

  • Tuesday, May 19, 2015
  • by mkraemer
  • Repository
  • 4 Watchers
  • 34 Stars
  • 11,179 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 13 Forks
  • 2 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

React-Inotify

Basic inotify bindings for React PHP., (*1)

Install

This library requires PHP5.3 and the inotify PECL extension. The best way to install this library is through composer:, (*2)

{
    "require": {
        "mkraemer/react-inotify": "1.1.0"
    }
}

Usage

This library provides the Inotify class which takes an event loop and optionally the timer interval in which the inotify events should be checked as constructor arguments. After initializing the class, you can use the add() method to add paths to the list of watched paths. Use the inotify bitmasks to define to which filesystem operations to listen., (*3)

<?php

$loop = React\EventLoop\Factory::create();
$inotify = new MKraemer\ReactInotify\Inotify($loop);

$inotify->add('/tmp/', IN_CLOSE_WRITE | IN_CREATE | IN_DELETE);
$inotify->add('/var/log/', IN_CLOSE_WRITE | IN_CREATE | IN_DELETE);

$inotify->on(IN_CLOSE_WRITE, function ($path) {
    echo 'File closed after writing: '.$path.PHP_EOL;
});

$inotify->on(IN_CREATE, function ($path) {
    echo 'File created: '.$path.PHP_EOL;
});

$inotify->on(IN_DELETE, function ($path) {
    echo 'File deleted: '.$path.PHP_EOL;
});

$loop->run();

The Versions

19/05 2015

dev-master

9999999-dev

Inotify bindings for ReactPHP

  Sources   Download

MIT

The Requires

 

by Marius KrÀmer

react inotify

19/05 2015

v1.1.0

1.1.0.0

Inotify bindings for ReactPHP

  Sources   Download

MIT

The Requires

 

by Marius KrÀmer

react inotify

27/05 2013

v1.0.0

1.0.0.0

Inotify bindings for ReactPHP

  Sources   Download

MIT

The Requires

 

by Marius KrÀmer

react inotify