pinga / crontab
A crontab written in PHP based on workerman
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/pinga/crontab
Requires
- php: >=8.2
- workerman/workerman: >=4.0.20
README
A crontab with precision in seconds written in PHP based on workerman, workerman/crontab and hyperf/crontab.
Install
composer require pinga/crontab
Usage
start.php
<?php use Workerman\Worker; require __DIR__ . '/../vendor/autoload.php'; use Pinga\Crontab\Crontab; $worker = new Worker(); $worker->onWorkerStart = function () { // Execute the function in the first second of every minute. new Crontab('1 * * * * *', function(){ echo date('Y-m-d H:i:s')."\n"; }); }; Worker::runAll();
Run with commands php start.php start
or php start.php start -d