PHPackages                             maximal/file-system-watch - 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. maximal/file-system-watch

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

maximal/file-system-watch
=========================

Simple poll-based synchronous file system watcher for PHP with no dependencies.

1.0.0(2y ago)03.8k—5.8%MITPHPPHP &gt;=8.1

Since Sep 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/maximal/file-system-watch-php)[ Packagist](https://packagist.org/packages/maximal/file-system-watch)[ RSS](/packages/maximal-file-system-watch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

File system watcher for PHP
===========================

[](#file-system-watcher-for-php)

This library is a simple poll-based synchronous file system watcher for PHP with no dependencies.

Usage Example
-------------

[](#usage-example)

```
use Maximal\FileSystem\Watch\EventType;
use Maximal\FileSystem\Watch\Watcher;

Watcher::create(__DIR__)
	// Poll the file system every second (1’000’000 microseconds)
	->setPollInterval(1_000_000)
	->onFileAdded(static function (string $path) {
		echo 'File added: ', $path, PHP_EOL;
	})
	->onFileChanged(static function (string $path, array $stat) {
		echo 'File changed: ', $path, '    @ ';
		echo (new DateTime('@' . $stat['mtime']))->format('c'), PHP_EOL;
	})
	->onFileDeleted(static function (string $path) {
		echo 'File deleted: ', $path, PHP_EOL;
	})
	->onDirectoryAdded(static function (string $path) {
		echo 'Directory added: ', $path, PHP_EOL;
	})
	->onDirectoryChanged(static function (string $path, array $stat) {
		echo 'Directory changed: ', $path, '    @ ';
		echo (new DateTime('@' . $stat['mtime']))->format('c'), PHP_EOL;
	})
	->onDirectoryDeleted(static function (string $path) {
		echo 'Directory deleted: ', $path, PHP_EOL;
	})
	// General event handler
	->onAnyEvent(static function (EventType $type, string $path, array $stat) {
		echo 'Event `', $type->value, '`: ', $path, '    @ ';
		echo (new DateTime('@' . $stat['mtime']))->format('c'), PHP_EOL;
	})
	->start();
```

Run it:

```
php  example.php
```

Contact the author
------------------

[](#contact-the-author)

- Website:  (Russian)
- Twitter:
- Telegram:
- Sijeko Company:  (web, mobile, desktop applications development and graphic design)
- Personal GitHub:
- Company’s GitHub:

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

973d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/980679?v=4)[MaximAL](/maintainers/maximal)[@maximal](https://github.com/maximal)

---

Top Contributors

[![maximal](https://avatars.githubusercontent.com/u/980679?v=4)](https://github.com/maximal "maximal (1 commits)")

---

Tags

libraryfilewatcherwatchfile system

### Embed Badge

![Health badge](/badges/maximal-file-system-watch/health.svg)

```
[![Health](https://phpackages.com/badges/maximal-file-system-watch/health.svg)](https://phpackages.com/packages/maximal-file-system-watch)
```

###  Alternatives

[crysalead/dir

Recursive directory scanner to locate directories and/or files in a file system

13214.5k4](/packages/crysalead-dir)[erlandmuchasaj/laravel-file-uploader

A simple package to help you easily upload files to your laravel project.

128.7k](/packages/erlandmuchasaj-laravel-file-uploader)

PHPackages © 2026

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