2017 © Pedro Peláez
 

yii2-extension yii2-cronjobs

Simple and convenient installing console commands as cron jobs for Yii framework

image

hzted123/yii2-cronjobs

Simple and convenient installing console commands as cron jobs for Yii framework

  • Thursday, April 20, 2017
  • by hzted123
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,309 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

Yii2 cronjobs extension

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)

Installation

  • Step 1: The preferred way to install this extension is through composer.

Either run, (*4)

php composer.phar require hzted123/yii2-cronjobs "*"

or add, (*5)

"hzted123/yii2-cronjobs": "*"

to the require section of your composer.json file. - Step 2: Set aliase @runnerScript in console config. This absolutely path to runner script Change path to runner script as your project., (*6)

Yii::setAlias('@runnerScript', dirname(__DIR__) . '/yii');
  • Step 3: Add to console config:
'controllerMap' => [
       'cron' => [
           'class' => 'hzted123\cronjobs\CronController',
           'cronJobs' =>[
            'test/example1' => [
                    'cron'      => '* * * * *',            
            ],
            'test/example2' => [
                    'cron'      => '10 * * * *',            
            ],

            ],
       ],
   ],
  • Step 4: Add task to system scheduler (cron on unix, task scheduler on windows) to run every minute:
* * * * * /path/to/yii/application/protected/yiic cron

You can point any settings from this., (*7)

The Versions

20/04 2017

dev-master

9999999-dev

Simple and convenient installing console commands as cron jobs for Yii framework

  Sources   Download

MIT

The Requires

 

by songming

extension yii2 cronjobs

20/04 2017

1.0.1

1.0.1.0

Simple and convenient installing console commands as cron jobs for Yii framework

  Sources   Download

MIT

The Requires

 

by songming

extension yii2 cronjobs

19/06 2016

1.0.0

1.0.0.0

Simple and convenient installing console commands as cron jobs for Yii framework

  Sources   Download

MIT

The Requires

 

by songming

extension yii2 cronjobs