robert-grubb/php-hotreload
最新稳定版本:v1.0.4
Composer 安装命令:
composer require robert-grubb/php-hotreload
包简介
Hot reload for scripts that stay alive via CLI.
README 文档
README
This is a simple package that will allow you to live reload a script that would stay alive via a cli command (daemon). For example, if you have a infinite while loop running in a script and do not want to stop and restart every time you make a change, this package will work well for you.
Credit
Thanks to the package felippe-regazio/php-hot-reloader for a great way to check for changes with a directory and files.
Installing
composer require robert-grubb/php-hotreload
Usage
require_once __DIR__ . '/vendor/autoload.php';
/**
* Instantiates new HotReloader and listens for changes the directory
* specified except for the ignored directory.
*/
$hotReloader = new HotReload\Instance([
'entryFile' => __DIR__ . '/test.php', // Entry file to run command
'entryArguments' => false, // String of arguments for entry (ex. --foo=bar)
'rootDirectory' => __DIR__, // The root directory
'watch' => [ '.' ], // List of files/directories to watch (Relative path to root)
'ignore' => [ 'ignored' ] // List of files/directories to ignore (Relative path to root)
]);
/**
* Start the reload watcher
*/
$hotReloader->startWatcher();
Preview
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-10
