1. Go to this page and download the library: Download 10quality/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/ */
10quality / scheduler example snippets
// 1) LOAD COMPOSER AUTOLOAD OR BOOTSTRAP FIRST
// 2)
use Scheduler\Scheduler;
Scheduler::ready([...])
->job('MyJob', function($task) {
// Here we define the task interval
return $task->daily()
->onException(function($e) {
// Do anything with exception
echo $e->getMessage();
});
});
Scheduler::ready([...])
->job('MyJob', function($task) {
// Here we define the task interval
return $task->daily()
->canReset()
->onException(function(Exception $e) {
// Do anything with exception
});
});