PHPackages                             lav45/watcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. lav45/watcher

ActiveLibrary[File &amp; Storage](/categories/file-storage)

lav45/watcher
=============

File change watcher

1.0.1(1y ago)0271MITPHPPHP &gt;=8.2

Since Aug 27Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/lav45/watcher)[ Packagist](https://packagist.org/packages/lav45/watcher)[ RSS](/packages/lav45-watcher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

File Watcher
============

[](#file-watcher)

Watcher listens and calls event handlers that happen to your files.

Usage example
-------------

[](#usage-example)

```
use Lav45\Watcher\Event;
use Lav45\Watcher\Listener;
use Lav45\Watcher\Watcher;

$watcher = (new Watcher(new Listener()))
    ->on(IN_CREATE | IN_MOVED_TO, static function(Event $event) {
        echo 'Create ' . $event->path . "\n";
    })
    ->on(IN_DELETE | IN_MOVED_FROM, static function(Event $event) {
        echo 'Delete ' . $event->path . "\n";
    })
    ->on(IN_MODIFY, static function(Event $event) {
        echo 'Update ' . $event->path . "\n";
    })
    ->withFilter(fn(Event $event): bool => \str_ends_with($event->path, '.json'))
    ->watchDirs([__DIR__]);

while (true) {
    $watcher->read();
    sleep(1);
}
```

Testing
-------

[](#testing)

```
docker run --rm -it -v $(pwd):/app composer install --ignore-platform-req=ext-inotify
docker run --rm -it -v $(pwd):/app composer test
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance62

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~263 days

Total

2

Last Release

365d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/675367?v=4)[Alex](/maintainers/LAV45)[@lav45](https://github.com/lav45)

---

Top Contributors

[![lav45](https://avatars.githubusercontent.com/u/675367?v=4)](https://github.com/lav45 "lav45 (7 commits)")

---

Tags

phpfilewatcherchange

### Embed Badge

![Health badge](/badges/lav45-watcher/health.svg)

```
[![Health](https://phpackages.com/badges/lav45-watcher/health.svg)](https://phpackages.com/packages/lav45-watcher)
```

###  Alternatives

[blueimp/jquery-file-upload

File Upload widget for jQuery.

141.5M18](/packages/blueimp-jquery-file-upload)[davaxi/vcalendar

PHP Class to generate VCalendar (ics) file

1180.8k](/packages/davaxi-vcalendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
