PHPackages                             ahmard/swotch - 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. ahmard/swotch

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

ahmard/swotch
=============

Swoole File Watcher

0.0.1(5y ago)428MITPHPPHP ^8.0

Since Jun 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Ahmard/swotch)[ Packagist](https://packagist.org/packages/ahmard/swotch)[ RSS](/packages/ahmard-swotch/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Swotch
======

[](#swotch)

[Swoole](https://swoole.co.uk) file system changes watcher.

Installation
------------

[](#installation)

```
composer require ahmard/swotch

```

Usage
-----

[](#usage)

#### Basic Usage

[](#basic-usage)

```
use Swotch\Watcher;

require 'vendor/autoload.php';

$paths = [
    __DIR__ . '/app/',
    __DIR__ . '/views/',
];

Watcher::watch($paths)->onAny(function (){
    echo "File changes detected\n";
});
```

#### Swoole Server Integration

[](#swoole-server-integration)

```
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Http\Server;
use Swotch\Watcher;

require 'vendor/autoload.php';

$server = new Server('0.0.0.0', 9000);
$server->on('request', function (Request $request, Response $response) {
    $response->end('Hello world');
});

$server->on('start', function (Server $server) {
    echo "Server started at http://0.0.0.0:9000\n";

    $paths = [
        __DIR__ . '/app/',
        __DIR__ . '/views/',
    ];

    Watcher::watch($paths)->onAny(fn() => $server->reload());
});

$server->start();
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

1838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b69fe34bd6492697a19cd8f33bde7a381cab0b7f8c0a01dcc7505f482458887?d=identicon)[Ahmard](/maintainers/Ahmard)

---

Tags

php-file-watcherphp-inotifyswooleswoole-watcherswotch

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ahmard-swotch/health.svg)

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

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

691146.0M211](/packages/react-stream)[react/child-process

Event-driven library for executing child processes with ReactPHP.

34691.0M158](/packages/react-child-process)[alchemy/binary-driver

A set of tools to build binary drivers

19511.1M40](/packages/alchemy-binary-driver)[react/zmq

ZeroMQ bindings for React.

2471.7M33](/packages/react-zmq)[mkraemer/react-pcntl

PCNTL bindings for ReactPHP

57290.7k9](/packages/mkraemer-react-pcntl)

PHPackages © 2026

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