cocur/watchman

PHP 对 facebook/watchman 的封装

v0.1 2014-04-27 21:27 UTC

This package is auto-updated.

Last update: 2024-09-20 10:12:25 UTC


README

PHP 对 facebook/watchman 的封装。

Latest Stable Version Build Status Code Coverage

特性

  • facebook/watchman 的简单 PHP 封装
  • 添加、列出和删除监视目录
  • 添加、列出和删除触发器
  • 兼容 PHP >= 5.4 和 HHVM

安装

您可以通过 Composer 安装 cocur/watchman

$ composer require cocur/watchman:@stable

在生产环境中,您应该将 @stable 替换为您想要使用的 版本

用法

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();

支持的 Watchman 命令

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

变更日志

版本 0.1 (2014 年 4 月 27 日)

  • 初始发布
  • 添加、删除和列出监视目录
  • 添加、删除和列出触发器

作者

Florian Eckerstorfer

许可证

MIT 许可证适用于 cocur/watchman。有关完整的版权和许可信息,请参阅与此源代码一起分发的 LICENSE 文件。