Render the symfony profiler toolbar in your terminal.

Related tags

console-toolbar-bundle
Overview

sourceability/console-toolbar-bundle

Render the symfony profiler toolbar in your terminal.

Screen Shot 2021-05-18 at 17 52 13

Each panel links to the corresponding web profiler page. Make sure to use a terminal that support hyperlinks to leverage this feature.

Installation

Install the bundle using composer:

$ composer require --dev sourceability/console-toolbar-bundle

Enable the bundle by updating config/bundles.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:

sourceability_console_toolbar:
    toolbar:
        base_url: http://localhost:8200/ # for the iTerm2 hyperlinks
        hidden_panels:
            - config
            - form
            - validator
            - logger

By default, the profiler does not always run in the test environment. You can enable it like this:

--- a/config/packages/test/web_profiler.yaml
+++ b/config/packages/test/web_profiler.yaml
@@ -3,4 +3,4 @@ web_profiler:
     intercept_redirects: false

 framework:
-    profiler: { collect: false }
+    profiler: { enabled:true, collect: true, only_exceptions: false }

Also add web profiler routes in config/routes/test/web_profiler.yaml

web_profiler_wdt:
    resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
    prefix: /_wdt

web_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:

default:
    extensions:
        FriendsOfBehat\SymfonyExtension: ~
        Sourceability\ConsoleToolbarBundle\Behat\SymfonyToolbarExtension: ~

This will display the console toolbar whenever a new symfony profile is detected:

Screen Shot 2021-05-18 at 17 52 13

PHPUnit

Add the following to your phpunit.xml configuration:

false 4 ">
    <extensions>
        <extension class="Sourceability\ConsoleToolbarBundle\PHPUnit\ConsoleToolbarExtension">
            <arguments>
                <boolean>falseboolean> 
                <integer>4integer> 
            arguments>
        extension>
    extensions>

Screen Shot 2021-05-18 at 17 46 52

Console

bin/console now has a new global option --toolbar:

Screen Shot 2021-05-18 at 18 02 22

This feature requires sourceability/instrumentation-bundle with the following configuration:

sourceability_instrumentation:
    profilers:
        symfony:
            enabled: true
    listeners:
        command:
            enabled: true
Issues
🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.

Contents Minimum Requirements Installation Upgrading Usage Quick Setup Examples API Appearance Menu Title Colour Width Padding Margin Borders Exit But

PHP School 1.8k Jun 10, 2021
ReactPHP Shell, based on the Symfony Console component.

Pecan Event-driven, non-blocking shell for ReactPHP. Pecan (/pɪˈkɑːn/) provides a non-blocking alternative to the shell provided in the Symfony Consol

Michael Crumm 43 Feb 1, 2021
Library for creating CLI commands or applications

Console Motivation: this library purpose is to provide a lighter and more robust API for console commands and/or applications to symfony/console. It c

Théo FIDRY 3 May 30, 2021
An Elegant CLI Library for PHP

Commando An Elegant PHP CLI Library Commando is a PHP command line interface library that beautifies and simplifies writing PHP scripts intended for c

Nate Good 789 May 24, 2021
PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal.

PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal. ??

Nuno Maduro 28 Jun 10, 2021
The Hoa\Console library.

Hoa is a modular, extensible and structured set of PHP libraries. Moreover, Hoa aims at being a bridge between industrial and research worlds. Hoa\Con

Hoa 358 Jun 1, 2021
PHP Version Manager for the CLI on Windows

This package has a much more niche use case than nvm does. When developing on Windows and using the integrated terminal, it's quite difficult to get those terminals to actually listen to PATH changes.

Harry Bayliss 15 May 24, 2021
A tiny REPL for PHP

Boris A tiny, but robust REPL for PHP. Announcement: I'm looking to add one or two additional collaborators with commit access. If you are actively in

null 2.2k Jun 20, 2021
PHP's best friend for the terminal.

Running PHP from the command line? CLImate is your new best bud. CLImate allows you to easily output colored text, special formats, and more. Installa

The League of Extraordinary Packages 1.7k Jun 16, 2021
Command-Line Interface tools

Aura.Cli Provides the equivalent of request ( Context ) and response ( Stdio ) objects for the command line interface, including Getopt support, and a

Aura for PHP 103 Jun 10, 2021
An object-oriented option parser library for PHP, which supports type constraints, flag, multiple flag, multiple values, required value checking

GetOptionKit Code Quality Versions & Stats A powerful option parser toolkit for PHP, supporting type constraints, flag, multiple flag, multiple values

Yo-An Lin 140 May 3, 2021
Lovely PHP wrapper for using the command-line

ShellWrap What is it? It's a beautiful way to use powerful Linux/Unix tools in PHP. Easily and logically pipe commands together, capture errors as PHP

James Hall 739 May 24, 2021
PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace

MODX Extra Publisher PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace. Installation global? local? To install packag

Ivan Klimchuk 3 May 14, 2021