PHP code example of oat-sa / extension-tao-scheduler
1. Go to this page and download the library: Download oat-sa/extension-tao-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/ */
oat-sa / extension-tao-scheduler example snippets
use oat\taoTaskQueue\scripts\tools\AddTaskToQueue;
$schedulerService->attach(
'*/5 * * * *',
new DateTime('now', new \DateTimeZone('utc')),
AddTaskToQueue::class,
[ActionClassToBeRun::class, 'param 1', 'param2']
);
$schedulerService->attach(
'* * * * *', //Reccurrence rule (repeat minutely)
new \DateTime('2017-12-12 20:00:00'), //Start date (time of first execution)
['taoExtension/ServiceName', 'methodName'] //Callback to be called.
);