Skip to content

jonny77/auto_reload

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

自动重启脚本

  • 使用inotify监听PHP源码目录
  • 程序文件更新时自动reload服务器程序

运行脚本

依赖inotifyswoole扩展

pecl install swoole
pecl install inotify
php daemon.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();

About

Inotify监控文件变更自动重启swoole_server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%