PHPackages                             crodas/watch-files - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. crodas/watch-files

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

crodas/watch-files
==================

Watch files and directories for changes

v0.1.9(9y ago)95.9k↓80%5BSD-4-ClausePHP

Since Aug 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/crodas/WatchFiles)[ Packagist](https://packagist.org/packages/crodas/watch-files)[ RSS](/packages/crodas-watch-files/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (12)Used By (5)

WatchFiles
==========

[](#watchfiles)

Stateless way of watching files and directory for changes.

It is useful when you compile files, and you would like a simple and efficient way of watching files and directories for changes to avoid re-compilation.

How to install
--------------

[](#how-to-install)

You can install it using composer.

```
composer require crodas/watch-files *
```

How to use it
-------------

[](#how-to-use-it)

```
require "vendor/autoload.php";

use WatchFiles\Watch;

// we'd like to watch some files
// and to save its state in foobar.php
$foobar = new Watch("foobar.php");
if ($foobar->isWatching()) {
  if (!$foobar->hasChanged()) {
    // somebody else before us started watching files/dirs
    // on foobar.php and *nothing* changed since last
    // time
    return;
  }
  // do heavy stuff here (Recompile it?)
  // we need to tell the watch that we're aware of lastest
  // changes and we'd like to update the file modification time
  $foobar->rebuild();
  return;
}

// we'd love to see when a new file has been added or deleted
$foobar->watchDir("foodir");
$foobar->watchDirs(array("foodir", 'foobar'));

// or monitor changes inside file or files
$foobar->watchFile("foodir.php");
$foobar->watchFiles(array("foodir.php", 'foobar.php'));

// start watching!
$foobar->watch();
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~123 days

Recently: every ~207 days

Total

10

Last Release

3603d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36463?v=4)[C](/maintainers/crodas)[@crodas](https://github.com/crodas)

---

Top Contributors

[![crodas](https://avatars.githubusercontent.com/u/36463?v=4)](https://github.com/crodas "crodas (59 commits)")

### Embed Badge

![Health badge](/badges/crodas-watch-files/health.svg)

```
[![Health](https://phpackages.com/badges/crodas-watch-files/health.svg)](https://phpackages.com/packages/crodas-watch-files)
```

###  Alternatives

[crodas/autoloader

Best autoloader from out there

113.0k5](/packages/crodas-autoloader)

PHPackages © 2026

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