PHPackages                             dmls/hypef-watch-stat - 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. dmls/hypef-watch-stat

ActiveLibrary

dmls/hypef-watch-stat
=====================

a hyperf watch driver

00PHP

Since Sep 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xywf221/hypef-watch-stat)[ Packagist](https://packagist.org/packages/dmls/hypef-watch-stat)[ RSS](/packages/dmls-hypef-watch-stat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

why this project
----------------

[](#why-this-project)

在使用 hypef watcher 的时候发现自带的 ScanFileDriver 文件稍微多点会导致 CPU 负载太高, 于是自己写了一个 StatFileDriver 占用率降低了很多.

原理
--

[](#原理)

使用stat函数获取文件的修改时间, 然后每次扫描的时候对比修改时间, 如果修改时间不一致则重新加载文件.

hypef 版本
--------

[](#hypef-版本)

2.0 or 3.0 swow扩展跟swoole扩展都可以

兼容的平台
-----

[](#兼容的平台)

- Linux
- MacOS
- Windows \[?\] 没测试应该是可以的

安装
--

[](#安装)

`composer require dmls/hypef-watch-stat`

使用
--

[](#使用)

修改 .watcher 文件 把里面的driver换成 StatFileDriver::class

```
return [
    'driver' => StatFileDriver::class,
    'bin' => 'php -d extension=swow',
    'watch' => [
        'dir' => ['./app','./config'],
        'file' => ['.env'],
        'scan_interval' => 2,
    ],
    'ext' => ['.env', '.php'],
];
```

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0658d3abe6c9d0081f9ca44cb845bb389b7fedc45e8d189e30a09f0a345920d2?d=identicon)[xydk936](/maintainers/xydk936)

### Embed Badge

![Health badge](/badges/dmls-hypef-watch-stat/health.svg)

```
[![Health](https://phpackages.com/badges/dmls-hypef-watch-stat/health.svg)](https://phpackages.com/packages/dmls-hypef-watch-stat)
```

PHPackages © 2026

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