wowthink/yii2-crond

crond

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

This package is not auto-updated.

Last update: 2024-09-29 05:21:54 UTC


README

安装方法

Composer

运行

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

或者

直接下载归档进行配置

common/config/main.php

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

用法

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

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

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

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

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

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

启动定时任务 php yii crond/run

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