Download the PHP package brash/phpwatcher without Composer

On this page you can find all versions of the php package brash/phpwatcher. 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 phpwatcher

PHP Watcher

This work is based on e-dant's watcher. It will watch any changes in the given filesystem path using PHP. Under the hood it uses Watcher, A filesystem event watcher that is simple, fast and efficient. Since it is only necessary to use the watcher binary to listen to any changes, this was the chosen method to keep tracking of any events that happen within the filesystem, as others usually have more overhead and consume more resources.

Usage

Here's how you can start watching a directory and get notified of any changes:

Integrated Binary

Besides directly call the API, it is useful to simply use composer to watch for a file and the current working directory:

This will watch for changes in all current working directory, i.e, root project where the vendor folder is located.

Change Types

Change types can be listened through the following API:

Where the effect type can be one of:

case RENAME = "rename";
case MODIFY = "modify";
case CREATE = "create";
case DESTROY = "destroy";
case OWNER = "owner";
case OTHER = "other";

Path type can be one of:

case DIR = 'dir';
case FILE = 'file';
case HARD_LINK = 'hard_link';
case SYM_LINK = 'sym_link';
case WATCHER = 'watcher';

And a callable should be provided in the signature function(WatchEvent $event): void.

Stopping the watcher gracefully

By default, the watcher will continue indefinitely when started. To gracefully stop the watcher, you can call shouldContinue and pass it a closure. If the closure returns a falsy value, the watcher will stop. The given closure will be executed every 0.5 second.

Watcher Speed

To change the Watcher's speed, simply use:

Versioning

This package follows the semver semantic versioning specification.


All versions of phpwatcher with dependencies

PHP Build Version
Package Version
Requires minicli/command-help Version ^1.0.1
minicli/minicli Version ^4.2
nunomaduro/termwind Version ^2.0
php Version ^8.3
revolt/event-loop Version ^1.0@dev
symfony/process Version ^7.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 brash/phpwatcher contains the following files

Loading the files please wait ....