Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swoole/auto_reload
Inotify监控文件变更自动重启swoole_server
https://github.com/swoole/auto_reload
Last synced: about 2 months ago
JSON representation
Inotify监控文件变更自动重启swoole_server
- Host: GitHub
- URL: https://github.com/swoole/auto_reload
- Owner: swoole
- Archived: true
- Created: 2015-10-14T02:46:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-10T09:20:39.000Z (over 8 years ago)
- Last Synced: 2024-05-22T18:33:02.477Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 2.93 KB
- Stars: 104
- Watchers: 12
- Forks: 31
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-swoole - Auto Reload - Official hot reload tool using inotify. (Development)
README
# 自动重启脚本
* 使用`inotify`监听PHP源码目录
* 程序文件更新时自动`reload`服务器程序运行脚本
----
依赖`inotify`和`swoole`扩展
```shell
pecl install swoole
pecl install inotify
php daemon.php
```运行程序
```php
require __DIR__.'/src/Swoole/ToolKit/AutoReload.php';//设置服务器程序的PID
$kit = new Swoole\ToolKit\AutoReload(2914);
//设置要监听的源码目录
$kit->watch(__DIR__.'/tests');
//监听后缀为.php的文件
$kit->addFileType('.php');
$kit->run();```