wowthink/yii2-crond

crond

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2019-06-06 06:08 UTC

README

安装方式

Composer

运行

composer require --prefer-dist wowthink/yii2-crond

或者

直接下载归档 进行配置

common/config/mian.php

    'aliases' => [
        'wowthink/crond' => '.../yii2-crond/src',
    ]

用法

安装扩展后,只需在代码中使用它 :

配置后台显示 backend/config/mian.php

    'modules' => [
        'crond' => [
            'class' => 'wowthink\crond\Module',
        ],
    ],

配置命令行 console/config/mian-local.php

    'bootstrap' => ['crond'],
    'modules' => [
        'crond' => [
            'class' => 'wowthink\crond\Module',
            'php_path' => '/usr/bin/php', //默认php
            'yii_path' => '/home/wwwroot/base/yii', //默认yii
        ],
    ],

执行migrate php yii migrate --migrationPath=@wowthink/crond/migrations

启动定时任务 php yii crond/run

默认进入后台地址:/crond/index/index avatar