dream 050bfac24d 1 | пре 8 месеци | |
---|---|---|
.. | ||
example | пре 8 месеци | |
src | пре 8 месеци | |
README.md | пре 8 месеци | |
composer.json | пре 8 месеци |
A crontab with precision in seconds written in PHP based on workerman.
composer require workerman/crontab
start.php
<?php
use Workerman\Worker;
require __DIR__ . '/../vendor/autoload.php';
use Workerman\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