PHPackages                             corzcode/yii2-swoole-crontab - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. corzcode/yii2-swoole-crontab

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

corzcode/yii2-swoole-crontab
============================

yii2 crontab developed based on swoole

v1.0(4y ago)150MITPHPPHP &gt;=7.0

Since May 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Corzcode/yii2-swoole-crontab)[ Packagist](https://packagist.org/packages/corzcode/yii2-swoole-crontab)[ RSS](/packages/corzcode-yii2-swoole-crontab/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/):

```
php composer.phar require corzcode/yii2-swoole-crontab dev-master

```

Basic Usage
-----------

[](#basic-usage)

main.php add config

```
return [
    'bootstrap' => [
        'cron', // 自动任务系统
    ],
    'components' => [
        'cron' => [
            'class' => 'yii\crontab\Crontab',
            'config'=>[
                'user' => 'www',
                'group' => 'www',
                'pid-file' => '@runtime/cron.pid',
                'log-file' => '@runtime/cron/run_cron.log'
            ],
            'cronfile' => __DIR__ . "/cron.php"
        ],
    ]
]

```

add cron.php file

```
