Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sourceability/console-toolbar-bundle
Render the symfony profiler toolbar in your terminal.
https://github.com/sourceability/console-toolbar-bundle
Last synced: 7 days ago
JSON representation
Render the symfony profiler toolbar in your terminal.
- Host: GitHub
- URL: https://github.com/sourceability/console-toolbar-bundle
- Owner: sourceability
- License: mit
- Created: 2021-05-04T16:46:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-28T14:18:05.000Z (almost 2 years ago)
- Last Synced: 2024-12-17T10:57:56.581Z (8 days ago)
- Language: PHP
- Homepage:
- Size: 75.2 KB
- Stars: 55
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sourceability/console-toolbar-bundle
Render the symfony profiler toolbar in your terminal.
Each panel links to the corresponding web profiler page.
Make sure to use a [terminal that support hyperlinks][hyperlink_terminals] to leverage this feature.## Installation
Install the bundle using composer:
```sh
$ composer require --dev sourceability/console-toolbar-bundle
```Enable the bundle by updating `config/bundles.php`:
```php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
// ...
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['dev' => true, 'test' => true],
Sourceability\ConsoleToolbarBundle\SourceabilityConsoleToolbarBundle::class => ['dev' => true, 'test' => true],
];
```Configure the bundle in `config/packages/{dev,test}/sourceability_console_toolbar.yaml`:
```yaml
sourceability_console_toolbar:
toolbar:
hidden_panels:
- config
- form
- validator
- logger
```If your application is not exposed at `http://localhost` exactly, make sure that
[you've configured the router request context][symfony_doc_request_context] for your environment.By default, the profiler does not always run in the `test` environment.
You can enable it like this:```diff
--- a/config/packages/test/web_profiler.yaml
+++ b/config/packages/test/web_profiler.yaml
@@ -3,4 +3,4 @@ web_profiler:
intercept_redirects: falseframework:
- profiler: { collect: false }
+ profiler: { enabled:true, collect: true, only_exceptions: false }
```Also add web profiler routes in `config/routes/test/web_profiler.yaml`
```yaml
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdtweb_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
```## Behat
This bundle becomes really useful when writing/debugging behat scenarios.
First enable the behat extension by adding the following to your behat configuration:
```yaml
default:
extensions:
FriendsOfBehat\SymfonyExtension: ~
Sourceability\ConsoleToolbarBundle\Behat\SymfonyToolbarExtension: ~
```This will display the console toolbar whenever a new symfony profile is detected:
## PHPUnit
Add the following to your `phpunit.xml` configuration:
```xml
false
4
```## Console
`bin/console` now has a new global option `--toolbar`:
This feature requires [sourceability/instrumentation][sourceability_instrumentation] with the following bundle configuration:
```yaml
sourceability_instrumentation:
profilers:
symfony:
enabled: true
listeners:
command:
enabled: true
```[hyperlink_terminals]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
[sourceability_instrumentation]: https://github.com/sourceability/instrumentation
[symfony_doc_request_context]: https://symfony.com/doc/4.4/routing.html#generating-urls-in-commands