yii2-console-runner-extension

在Yii框架中在后台运行控制台命令的扩展。(An extension for running console commands on background in Yii framework.)

Github星跟蹤圖

Console Runner(控制台运行器)

在Yii框架中在后台运行控制台命令的扩展。

安装

将以下内容添加到 composer.json

"vova07/yii2-console-runner-extension": "*"

然后执行 composer install

用法

导入 class:

use vova07\console\ConsoleRunner;
$cr = new ConsoleRunner(['file' => '@my/path/to/yii']);
$cr->run('controller/action param1 param2 ...');

应用组件

// config.php
...
components [
    'consoleRunner' => [
        'class' => 'vova07\console\ConsoleRunner',
        'file' => '@my/path/to/yii' // or an absolute path to console file
    ]
]
...

// some-file.php
Yii::$app->consoleRunner->run('controller/action param1 param2 ...');

运行 Tests

$ phpunit

主要指標

概覽
名稱與所有者vova07/yii2-console-runner-extension
主編程語言PHP
編程語言PHP (語言數: 1)
平台BSD, Linux, Mac, Windows
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2014-04-21 11:11:43
推送於2019-07-02 09:32:46
最后一次提交2018-01-20 19:10:40
發布數3
最新版本名稱0.1.2 (發布於 2018-01-20 19:16:27)
第一版名稱0.1.0 (發布於 2014-11-26 12:48:05)
用户参与
星數87
關注者數13
派生數24
提交數24
已啟用問題?
問題數9
打開的問題數4
拉請求數4
打開的拉請求數1
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Console Runner

Latest Version
Software License
Build Status
Coverage Status
Quality Score
Total Downloads

An extension for running console commands on background in Yii framework.

Installation

Add the following to require section of your composer.json:

"vova07/yii2-console-runner-extension": "*"

Then do composer install.

Usage

Imported class:
use vova07\console\ConsoleRunner;
$cr = new ConsoleRunner(['file' => '@my/path/to/yii']);
$cr->run('controller/action param1 param2 ...');
Application component:
// config.php
...
components [
    'consoleRunner' => [
        'class' => 'vova07\console\ConsoleRunner',
        'file' => '@my/path/to/yii' // or an absolute path to console file
    ]
]
...

// some-file.php
Yii::$app->consoleRunner->run('controller/action param1 param2 ...');

Running Tests

$ phpunit