Download the PHP package brunonatali/inotify without Composer

On this page you can find all versions of the php package brunonatali/inotify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package inotify

Inotify

Inotify is a filesystem monitor event based. This lib aim to be file change notification within PHP React.

Table of Contents

Before start

BEFORE BEGIN - You must install inotify extension to make this library work.
After installation, you must place new extension config to your php.ini file, if extension was not declared, system will try to load automatically (using dl()) and throws an exception if was unable to proceed.
Follow quickstart example and use try-catch method to build this class.

Quickstart example

Register / Deregister

This lib is driven by Événement and so after add() you must register an event to catch.
Follow to the next functions and examples.

add()

To start watch some file, just call add(string $fileName, int $flags) :

Note. You can concatenate flags as exaple above.
Returns true if sucessfully added

remove()

The remove way is simple as add

Returns true if removed or not exists

stopAll()

This will remove() all watchers.
This function needs no parmans an returns nothing
Note. Additionaly you can call getAll() and stop one by one.

Events

To receive any registered event you must register usin on(FLAG_NAME, callable):

If you plan to get noticed when any mask was triggered, use "all" (lowercase) as FLAG_NAME.

After registered, when watcher fires an event program will call your function. Ex.

And this will fire access event causing your code to telling you that file was accessed:

General

getAll()

Returns an array containing all registered files to watch in this structure:

getLastError()

In most of cases, this functions, will not throw an exception, but will return false. To let you best track the reson why fail to do something this lib will provide textual error, just call getLastError() right after failure.

Supported flags

Some function explained above needs flag to tell them when trigger an event or how to handle triggered event.
This flags was called by developer as constants and originally posted here.
If you want to know its value, follow this list:
IN_ACCESS = 1
IN_MODIFY = 2
IN_ATTRIB = 4
IN_CLOSE_WRITE = 8
IN_CLOSE_NOWRITE = 16
IN_OPEN = 32
IN_MOVED_FROM = 64
IN_MOVED_TO = 128
IN_CREATE = 256
IN_DELETE = 512
IN_DELETE_SELF = 1024
IN_MOVE_SELF = 2048
IN_UNMOUNT = 8192
IN_Q_OVERFLOW = 16384
IN_IGNORED = 32768
IN_CLOSE = 24
IN_MOVE = 192
IN_ALL_EVENTS = 4095
IN_ONLYDIR = 16777216
IN_DONT_FOLLOW = 33554432
IN_MASK_ADD = 536870912
IN_ISDIR = 1073741824
IN_ONESHOT = 4294967295

Install

The recommended way to install this library is through Composer. New to Composer?

This project follows SemVer. This will install the latest supported version:

This project aims to run on Linux and require inotify PHP extensions, but actually not tested in all environments. If you find a bug, please report.

License

MIT, see LICENSE file.


All versions of inotify with dependencies

PHP Build Version
Package Version
Requires php Version >=7
react/event-loop Version ^1.1
evenement/evenement Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brunonatali/inotify contains the following files

Loading the files please wait ....