yiivgeny/yii-phpdoc-crontab

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

Installs: 1 318

Dependents: 0

Suggesters: 0

Security: 0

Stars: 30

Watchers: 5

Forks: 14

Open Issues: 1

Type:yii-extension

0.1 2014-03-07 12:50 UTC

This package is not auto-updated.

Last update: 2024-03-28 16:11:07 UTC


README

#Yii PHPDocCrontab extension Simple and convenient installing console commands as cron jobs.

  • One control point to run all commands
  • Crossplatform job installing
  • Store schedule of launches with application source
  • Grouping jobs (example: segmentation by server)

##Requirements Yii Framework 1.1.6 or above

##Usage Installing action 'Example1' of command 'Test' to run every 10 minutes. Just add doc-comment for console action.

class TestCommand extends CConsoleCommand{
    /**
     * @cron 10 * * * *
     */
    public function actionExample1(){}
}

##Installation

  • Step 1: Put directory PHPDocCrontab (or only PHPDocCrontab.php) into your framework extensions directory.
  • Step 2: Add PHPDocCrontab.php as new console command on framework config:
'commandMap' => array(
    'cron' => 'ext.PHPDocCrontab.PHPDocCrontab'
)
  • Step 3: Add task to system scheduler (cron on unix, task scheduler on windows) to run every minute:
* * * * * /path/to/yii/application/protected/yiic cron

##Resources