yiisoft / yii2-shell
The interactive shell extension for Yii framework
Fund package maintenance!
Open Collective
Installs: 2 088 575
Dependents: 71
Suggesters: 0
Security: 0
Stars: 137
Watchers: 26
Forks: 23
Open Issues: 0
Type:yii2-extension
Requires
- psy/psysh: ~0.9.3|~0.10.3|^0.11.0
- symfony/var-dumper: ~2.7|~3.0|~4.0|~5.0
- yiisoft/yii2: ~2.0.0
README
Interactive Shell Extension for Yii 2
This extension provides an interactive shell for Yii framework 2.0 based on psysh.
For license information check the LICENSE-file.
Installation
The preferred way to install this extension is through composer.
Either run
composer require yiisoft/yii2-shell
or add
"yiisoft/yii2-shell": "~2.0.0"
to the require
section of your composer.json.
Usage
After installation, you will be able to run the interactive shell via command line:
# Change path to your application's root directory
cd path/to/myapp
# Start the interactive shell
./yii shell
You can access the application object using Yii::$app
. Additionally you have access to all your and your dependencies' classes.
See psysh's website for a list of available features.
Configuration
You can configure the PsySH shell by setting options via the shellConfig
variable in the controller, i.e. add this to your console application configuration:
'controllerMap' => [
'shell' => [
'shellConfig' => [
'updateCheck' => 'weekly',
'verbosity' => \Psy\Configuration::VERBOSITY_VERBOSE,
],
],
],
See https://github.com/bobthecow/psysh/wiki/Config-options for a list of PsySH configurable options.
Note: updateCheck
is explictly set to never by yii2-shell. All other PsySH options use default values.
Screenshot
The following screenshot shows a usage example: