huynhtuvinh87 / yii2-console-runner
Yii run console
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.6.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-01-27 16:43:46 UTC
README
This is component for running console command in yii2 web applications
Installation
The preferred way to install this extension is through composer.
To install, either run
$ composer require huynhtuvinh87/yii2-console-runner "*"
or add
"huynhtuvinh87/yii2-console-runner": "*"
to the require
section of your composer.json
file.
Usage
You can user yii2-console-runner importing the class file
use huynhtuvinh87\console\Runner; $output = ''; $runner = new Runner(); $runner->run('controller/action param1 param2 ...', $output); echo $output; //prints the command output
or using it like an application component:
//you config file 'components' => [ 'consoleRunner' => [ 'class' => 'toriphes\console\Runner' ] ]
//some application file $output = ''; Yii::$app->consoleRunner->run('controller/action param1 param2 ...', $output); echo $output; //prints the command output