PHP code example of orisai / scheduler
1. Go to this page and download the library: Download orisai/scheduler library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
orisai / scheduler example snippets
use Cron\CronExpression;
use Orisai\Scheduler\SimpleScheduler;
$scheduler = new SimpleScheduler();
// Add jobs
$scheduler->addJob(
new CallbackJob(fn() => exampleTask()),
new CronExpression('* * * * *'),
);
$scheduler->run();
* * * * * cd path/to/project && php bin/scheduler.php >> /dev/null 2>&1