Download the PHP package ryx16/file-watcher without Composer
On this page you can find all versions of the php package ryx16/file-watcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package file-watcher
file-watcher
spl+ forked from easy-swoole/file-watcher
使用规则
WatchRule
监控目录:
`
指定忽略目录:
指定忽略文件:
指定匹配后缀:
type为SCAN_TYPE_SUFFIX_MATCH时,只匹配后缀必须在suffix规则数组的文件。 type为SCAN_TYPE_IGNORE_SUFFIX时,会忽略掉后缀在suffix规则数组的文件。
FileWatcher
设置监控程序:
`
二选一 不调用此方法 存在inotify扩展默认为Inotify::class反之FileScanner::class
增加监控规则:
可进行多次调用 对不同目录设置不同的规则
设置异常回调:
设置检测周期(默认1000ms
):
设置触发回调(文件有变化):
启动(swoole服务中使用):
EasySwoole中用于热重启
例如在Easyswoole
开发模式中,我们希望当有代码变动的时候,实现Server重启,示例代码如下:
注意,reload仅仅针对Worker进程加载的代码有效
All versions of file-watcher with dependencies
PHP Build Version
Package Version
The package ryx16/file-watcher contains the following files
Loading the files please wait ....