PHPackages                             cocur/watchman - 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. cocur/watchman

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

cocur/watchman
==============

PHP wrapper for facebook/watchman

v0.1(12y ago)81.0kMITPHPPHP &gt;=5.4

Since Apr 27Pushed 12y ago1 watchersCompare

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

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

cocur/watchman
==============

[](#cocurwatchman)

> PHP wrapper for [`facebook/watchman`](https://github.com/facebook/watchman).

[![Latest Stable Version](https://camo.githubusercontent.com/527efc7bea21f5c50d6373006cf8f3dfef05143596679d2c33229832f0f9e44c/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6375722f77617463686d616e2e737667)](https://packagist.org/packages/cocur/watchman)[![Build Status](https://camo.githubusercontent.com/0373dde102e1e755939875f42cce5d2f5a91c9dda4b319eec535de8b6f166ee4/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f636f6375722f77617463686d616e2e737667)](https://travis-ci.org/cocur/watchman)[![Code Coverage](https://camo.githubusercontent.com/0f9dc72b631db2294113c3f7f8cdb79d3200c192e09fb82eb4ca77964db84a59/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f636f6375722f77617463686d616e2e737667)](https://coveralls.io/r/cocur/watchman)

Features
--------

[](#features)

- Simple PHP wrapper for [`facebook/watchman`](https://github.com/facebook/watchman)
- Add, list and delete watched directories
- Add, list and delete triggers
- Compatible with PHP &gt;= 5.4 and [HHVM](http://hhvm.com/)

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

[](#installation)

You can install `cocur/watchman` through [Composer](https://getcomposer.org):

```
$ composer require cocur/watchman:@stable
```

*In a production environment you should replace `@stable` with the [version](https://github.com/cocur/watchman/releases) you want to use.*

Usage
-----

[](#usage)

```
use Cocur\Watchman\Watchman;

$watchman = new Watchman();
$watch = $watchman->addWatch('/var/www/foobar');
$trigger = $watch->addTrigger('foo', '*.js', 'ls -al');

// Retrieve all watched directories
$watched = $watchman->listWatches();

// Retrieve all triggers from a watch
$triggers = $watch->listTriggers();

// Later...
$trigger->delete();
$watch->delete();
```

Supported Watchman commands
---------------------------

[](#supported-watchman-commands)

- watch ✓
- watch-list ✓
- watch-del ✓
- clock ✓
- trigger ✓
- trigger-list ✓
- trigger-del ✓
- find ✓
- query ✓
- since ✓
- log-level ✓
- log ✓
- shutdown-server ✓
- subscribe
- unsubscribe
- get-sockname ✓

Changelog
---------

[](#changelog)

### Version 0.1 (27 April 2014)

[](#version-01-27-april-2014)

- Initial release
- Add, delete and list watched directories
- Add, delete and list triggers

Author
------

[](#author)

[**Florian Eckerstorfer**](http://florian.ec)

- [Twitter](http://twitter.com/Florian_)

License
-------

[](#license)

The MIT license applies to **cocur/watchman**. For the full copyright and license information, please view the LICENSE file distributed with this source code.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

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

4402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a80f9fc61cd3a7d7779e8f120b458ca4d18fdd885d719bb77d3379b96bf714d9?d=identicon)[florianeckerstorfer](/maintainers/florianeckerstorfer)

---

Tags

filesystemwatchwatchman

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cocur-watchman/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72528.6M91](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

226231.8M39](/packages/league-flysystem-local)[oneup/flysystem-bundle

Integrates Flysystem filesystem abstraction library to your Symfony project.

64422.9M66](/packages/oneup-flysystem-bundle)

PHPackages © 2026

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