sourceability/console-toolbar-bundle
Composer 安装命令:
composer require sourceability/console-toolbar-bundle
包简介
This bundle enables displaying the web toolbar in the console/terminal.
README 文档
README
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 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: 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 for your environment.
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:
PHPUnit
Add the following to your phpunit.xml configuration:
<extensions> <extension class="Sourceability\ConsoleToolbarBundle\PHPUnit\ConsoleToolbarExtension"> <arguments> <boolean>false</boolean> <!-- always show, if false use: TOOLBAR=true phpunit ...--> <integer>4</integer> <!-- Indentation --> </arguments> </extension> </extensions>
Console
bin/console now has a new global option --toolbar:
This feature requires sourceability/instrumentation with the following bundle configuration:
sourceability_instrumentation: profilers: symfony: enabled: true listeners: command: enabled: true
sourceability/console-toolbar-bundle 适用场景与选型建议
sourceability/console-toolbar-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 427.25k 次下载、GitHub Stars 达 55, 最近一次更新时间为 2021 年 05 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sourceability/console-toolbar-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sourceability/console-toolbar-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 427.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 55
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-18


