dev-master
9999999-devcronjobs
BSD-3-Clause
The Requires
by Denis Porplenko
extension yii2 cronjobs
cronjobs
Easiest way to put crontab on your console scripts., (*1)
This extension is based on this. Thanks Yiivgeny., (*2)
But with a few changes: - Work eith yii2 - Set config in params (not in phpDocs)., (*3)
I transfer settings of crontab in local settings(params) configuration, so that the application can be run on different servers with different sets of crontab., (*4)
Either run, (*5)
php composer.phar require --prefer-dist denisogr/yii2-cronjobs "dev-master"
or add, (*6)
"denisogr/yii2-cronjobs": "dev-master"
to the require section of your composer.json
file.
- Step 2: Set aliase @runnerScript in console config. This absolutely path to runner script (I can not find another way to get runner script).
Change path to runner script as your project (For Yii2 Basic application)., (*7)
Yii::setAlias('@runnerScript', dirname(__DIR__) .'/yii');
'controllerMap' => [ 'cron' => [ 'class' => 'denisog\cronjobs\CronController' ], ],
* * * * * /path/to/yii/application/protected/yiic cron
Add in params array with cron sets:, (*8)
'cronJobs' =>[ 'test/example1' => [ 'cron' => '* * * * *', ], 'test/example2' => [ 'cron' => '10 * * * *', ], ],
You can point any settings from this., (*9)
cronjobs
BSD-3-Clause
extension yii2 cronjobs