filippo-toso/php-supervisor
最新稳定版本:v1.0.1
Composer 安装命令:
composer require filippo-toso/php-supervisor
包简介
A simple supervisor class that allows to run long lived PHP scripts from the crontab
README 文档
README
A simple supervisor tool that allows to run PHP long running scripts through crontab.
Requirements
- PHP 5.6+
Installing
Use Composer to install it:
composer require filippo-toso/php-supervisor
Using It
Create a simple PHP script with a code like the following:
use FilippoToso\PhpSupervisor\Supervisor;
Supervisor::run(function() {
// Do your long lived stuff here
}, __DIR__ . '/lock.dat', __DIR__ . '/stop.dat');
Then call the script every minute from the crontab. The code in the closure will be kept running untill the $stopFile specified in the third parameter exists (stop.dat in the example).
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-19