easyswoole / crontab
easyswoole extension tool library
Installs: 29 403
Dependents: 3
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 7
Open Issues: 1
Requires
- php: >=8.0
- dragonmantank/cron-expression: ^2.2
- easyswoole/component: ^2.0
Requires (Dev)
README
Script Test
<?php use EasySwoole\Crontab\Crontab; use EasySwoole\Crontab\Tests\Jobs\JobPerMin; require_once 'vendor/autoload.php'; $http = new Swoole\Http\Server('0.0.0.0', 9501); $crontab = new Crontab(); $crontab->register(new JobPerMin()); $crontab->attachToServer($http); $http->on('request', function ($request, $response) use ($crontab) { $ret = $crontab->rightNow('JobPerMin'); $response->header('Content-Type', 'text/plain'); $response->end('Hello World ' . $ret); }); $http->start();