meliorator/yii2-cron
最新稳定版本:0.0.5
Composer 安装命令:
composer require meliorator/yii2-cron
包简介
Create Cron jobs from browser, and look that run logs
README 文档
README
Create Cron jobs from browser, and look that run logs
Forked from sharkom/yii2-cron with some modifications
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist meliorator/yii2-cron "*"
or add
"meliorator/yii2-cron": "*"
to the require section of your composer.json file.
Migration
Run the following command in Terminal for database migration:
yii migrate/up --migrationPath=@meliorator/cron/migrations
Or use the namespaced migration (requires at least Yii 2.0.10):
// Add namespace to console config: 'controllerMap' => [ 'migrate' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationPath' => [ '@meliorator/cron/migrations', ], ], ],
Then run:
yii migrate/up
Web Application Config
Turning on the Cron Job Manager Module in the web application:
Simple example:
'modules' => [ 'cron' => [ 'class' => 'meliorator\cron\Module', ], ],
Console Application Config
Turning on the Cron Job Manager Module in the console application:
Simple example:
'modules' => [ 'cron' => [ 'class' => 'meliorator\cron\Module', ], ],
Schedule Config
Set the server schedule to run the following command
On Linux:
Add to the crontab with the user who you want to run the script (possibly not root) with the crontab -e command or by editing the /etc/crontab file
* * * * * <your-application-folder>/yii cron/cron/run 2>&1
On Windows:
Open the task scheduler and create a new task
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-23