# yii2-cron **Repository Path**: homeleaf/yii2-cron ## Basic Information - **Project Name**: yii2-cron - **Description**: 把yii2的定时任务集中到一个yii2文件中进行统一管理 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2018-03-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 使用方法 === 在安装之前添加仓库到composer.json文件中 ``` "repositories": [{"type": "vcs", "url": "https://git.oschina.net/zjq528/yii2-cron.git"}], ``` composer require webjson/yii2-cron ``` command('hello/index')->everyHour(); } } ``` ScheduleController是一个抽象类,里面有一个抽象方法 actionRun 这里就放要定时执行的任务 最后在crontab里面添加 ``` * * * * * php yii test/run ```