Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mloberg/consolebundle
Interact with Symfony's container on the command line
https://github.com/mloberg/consolebundle
psysh symfony-bundle
Last synced: 3 months ago
JSON representation
Interact with Symfony's container on the command line
- Host: GitHub
- URL: https://github.com/mloberg/consolebundle
- Owner: mloberg
- License: mit
- Archived: true
- Created: 2015-07-07T23:29:05.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2020-08-23T17:34:17.000Z (over 4 years ago)
- Last Synced: 2024-09-29T17:23:04.577Z (3 months ago)
- Topics: psysh, symfony-bundle
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ConsoleBundle
Interact with Symfony's container through the command line. Uses [Psysh](http://psysh.org/)
for the console.## Installation
composer require --dev mlo/console-bundle
If you aren't using Symfony Flex, you will need to register the bundle in
`AppKernel.php` in the `dev` and/or `test` environment.```php
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Mlo\ConsoleBundle\MloConsoleBundle();
}
```If you are using Symfony 4 or lower, require the [v1](https://github.com/mloberg/ConsoleBundle/tree/v1)
version of this package.composer require --dev mlo/console-bundle:^1.0
## Usage
bin/console tinker
This will drop you in a Psysh shell with the variables `$container`, `$kernel`
and `$this`, which references the container.## Adding Variables
You can add custom variables to the shell scope with the following config:
```yaml
mlo_console:
variables:
debug: "%kernel.debug%"
em: "@doctrine.orm.entity_manager"
```Now you will have a `$debug` variable with the value of the _kernel.debug_
parameter and `$em` with your entity manager.