https://github.com/realflowcontrol/react-inotify
Event driven / non-blocking inotify stream in ReactPHP
https://github.com/realflowcontrol/react-inotify
filewatcher inotify reactphp
Last synced: about 1 month ago
JSON representation
Event driven / non-blocking inotify stream in ReactPHP
- Host: GitHub
- URL: https://github.com/realflowcontrol/react-inotify
- Owner: realFlowControl
- License: mit
- Created: 2019-05-13T18:31:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-27T15:47:56.000Z (5 months ago)
- Last Synced: 2025-03-08T19:06:17.313Z (about 1 month ago)
- Topics: filewatcher, inotify, reactphp
- Language: PHP
- Homepage:
- Size: 13.1 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flow-control/react-inotify
[](https://github.com/flow-control/react-inotify/actions)
[](https://codecov.io/gh/flow-control/react-inotify)
[](https://github.com/flow-control/react-inotify)
[](https://packagist.org/packages/flow-control/react-inotify)Simple, async inotify event handler build with ReactPHP
This library is heavily inspired by [reactphp/stream](https://github.com/reactphp/stream).
## Dependencies
This library depends on the [PHP Inotify extension](https://pecl.php.net/package/inotify), available via PECL
```bash
$ pecl install inotify
```## PHP Version Support
If you are looking for PHP 7 support you need to install `flow-control/react-inotify` in version 1. Version 2 dropped support for PHP 7.
## Usage
### Install
```bash
$ composer require flow-control/react-inotify
```### How to use
Create an object from the `\Flowcontrol\React\Inotify\InotifyStream` class
and register your event handlers.```php
$inotify = new \Flowcontrol\React\Inotify\InotifyStream();
$inotify->on('event', function (array $data) {
var_dump($data);
});
$inotfiy->addWatch(__DIR__, IN_CLOSE_WRITE);
```## Tests
```bash
$ composer install
$ composer test
```## Build with
- [ReactPHP](https://reactphp.org/)
- [evenement/evenement](https://github.com/igorw/evenement)## License
MIT, see [LICENSE file](LICENSE).