library yii-phpdoc-crontab
yiivgeny/yii-phpdoc-crontab
- Thursday, August 2, 2018
- by Yiivgeny
- Repository
- 6 Watchers
- 33 Stars
- 1,171 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 13 Forks
- 1 Open issues
- 3 Versions
- 0 % Grown
Yii PHPDocCrontab extension
Simple and convenient installing console commands as cron jobs., (*1)
- 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, (*2)
Usage
Installing action 'Example1' of command 'Test' to run every 10 minutes. Just add doc-comment for console action., (*3)
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