https://github.com/vova07/yii2-console-runner-extension
An extension for running console commands on background in Yii framework.
https://github.com/vova07/yii2-console-runner-extension
background background-runner commands console console-runner runner yii2
Last synced: 2 months ago
JSON representation
An extension for running console commands on background in Yii framework.
- Host: GitHub
- URL: https://github.com/vova07/yii2-console-runner-extension
- Owner: vova07
- License: bsd-3-clause
- Created: 2014-04-21T11:11:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T09:32:46.000Z (almost 6 years ago)
- Last Synced: 2025-04-02T08:11:13.372Z (2 months ago)
- Topics: background, background-runner, commands, console, console-runner, runner, yii2
- Language: PHP
- Size: 31.3 KB
- Stars: 87
- Watchers: 13
- Forks: 24
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Console Runner
[](https://github.com/vova07/yii2-console-runner-extension/releases)
[](LICENSE.md)
[](https://travis-ci.org/vova07/yii2-console-runner-extension)
[](https://scrutinizer-ci.com/g/vova07/yii2-console-runner-extension/code-structure)
[](https://scrutinizer-ci.com/g/vova07/yii2-console-runner-extension)
[](https://packagist.org/packages/vova07/yii2-console-runner-extension)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:
```php
use vova07\console\ConsoleRunner;
$cr = new ConsoleRunner(['file' => '@my/path/to/yii']);
$cr->run('controller/action param1 param2 ...');
```##### Application component:
```php
// 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
```bash
$ phpunit
```