vova07/yii2-console-runner-extension

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

Installs: 159 272

Dependents: 4

Suggesters: 0

Security: 0

Stars: 87

Watchers: 14

Forks: 24

Open Issues: 5

Type:yii2-extension

0.1.2 2018-01-20 17:10 UTC

This package is not auto-updated.

Last update: 2024-12-21 16:31:03 UTC


README

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