Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiisoft/yii2-shell
Interactive shell
https://github.com/yiisoft/yii2-shell
hacktoberfest php psysh shell yii yii2
Last synced: 29 days ago
JSON representation
Interactive shell
- Host: GitHub
- URL: https://github.com/yiisoft/yii2-shell
- Owner: yiisoft
- License: bsd-3-clause
- Created: 2016-03-04T13:06:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-26T12:46:38.000Z (11 months ago)
- Last Synced: 2024-04-15T03:00:03.360Z (7 months ago)
- Topics: hacktoberfest, php, psysh, shell, yii, yii2
- Language: PHP
- Homepage: https://www.yiiframework.com/
- Size: 140 KB
- Stars: 138
- Watchers: 25
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Interactive Shell Extension for Yii 2
This extension provides an interactive shell for [Yii framework 2.0](https://www.yiiframework.com) based on [psysh](https://psysh.org/).
For license information check the [LICENSE](LICENSE.md)-file.
[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-shell/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-shell)
[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-shell/downloads.png)](https://packagist.org/packages/yiisoft/yii2-shell)Installation
------------The preferred way to install this extension is through [composer](https://getcomposer.org/download/).
Either run
composer require yiisoft/yii2-shell
or add
```json
"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](https://psysh.org/#features) 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](screenshot.png)