yiisoft/yii2-shell The interactive shell extension for Yii framework

shell

993323

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.

Latest Stable Version Total Downloads

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:

Usage example of Yii2 shell

Changelog

Yii Framework 2 Shell extension Change Log

2.0.6 under development

  • Enh #32: Disable update check, allow configuring PsySH (flaviovs)

2.0.5 September 04, 2022

  • Enh #28: Allow psy/psysh ^0.11.0 additionally (wa1kb0y)

2.0.4 May 02, 2020

  • Enh #27: Allow psy/psysh ~0.10.3 additionally to ~0.9.3 (tobiase)

2.0.3 March 03, 2020

  • Enh #26: Add compatibility with symfony/var-dumper 5.x (samdark)

2.0.2 January 07, 2019

  • Enh #19: Bump psy/psysh to ~0.9.3 (ricpelo)

2.0.1 March 26, 2018

  • Enh #10, #13: Updated psy version (kyle-mccarthy, samdark)

2.0.0 November 22, 2016

  • Initial release.

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



2.0.5 is the latest of 6 releases



BSD-3-Clause license
Stats
138 github stars & 22 github forks
1352 downloads in the last day
37093 downloads in the last 30 days
1817742 total downloads