1. Go to this page and download the library: Download rvkulikov/yii2-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/ */
rvkulikov / yii2-scheduler example snippets
use Rvkulikov\Yii2\Scheduler\Components\ConnectionLocatorInterface;
use Rvkulikov\Yii2\Scheduler\Components\JobsLocator;
use Rvkulikov\Yii2\Scheduler\Components\JobsLocatorInterface;
use Rvkulikov\Yii2\Scheduler\Components\SettingsLocatorInterface;
use Rvkulikov\Yii2\Scheduler\Module as ScheduleModule;
return [
'modules' => [
/// регистрировать можно только в консольном приложении
/// или в приложении, которое не смотрит наружу, так как
/// в контроллерах нет авторизации
'schedule' => ['class' => ScheduleModule::class],
],
'container' => [
'singletons' => [
ConnectionLocatorInterface::class => [
'db' => 'dbApp',
'schema' => $params['db_app.schema_app_schedule']
],
JobsLocatorInterface::class => [
'preprocessor' => [JobsLocator::class, 'preprocessTuples'],
'definitions' => fn() =>