nofutur3 / tracy-gitpanel
nette 扩展 - 将 GIT 面板添加到 tracy 面板 - 显示当前 GIT 分支。
v0.9.7
2024-02-05 10:20 UTC
Requires
- php: >=5.6
- tracy/tracy: ~2.2
Requires (Dev)
- codeception/codeception: ^2.2
- friendsofphp/php-cs-fixer: ^2.10
- phpstan/phpstan-shim: ^0.9.2
This package is auto-updated.
Last update: 2024-09-05 11:28:01 UTC
README
这是一个简单的 Tracy 扩展,用于显示当前 GIT 分支的信息。
安装
推荐使用 composer 进行安装。
composer req nofutur3/tracy-gitpanel
替代方法 - 如果您无法使用 composer。将源代码(例如克隆 git 仓库)下载到您的项目中,并以某种方式引用它。对于 nette 框架,在您的引导文件中可以这样操作
$configurator ->createRobotLoader() ->addDirectory(__DIR__ . 'path/to/library/');
配置
在您的 nette 应用程序中,操作很简单,只需将这些行添加到您的配置文件中。根据您配置文件的结构,但您可以使用基本的 config.neon 文件。我通常只将行添加到 config.local.neon 文件中,因为我不需要在生产模式中使用此扩展。
Nette 2.3+
tracy: bar: - Nofutur3\GitPanel\Diagnostics\Panel
如果您想设置受保护的分支(默认情况下,它仅使用 master 分支),只需将分支名称数组传递给面板即可
parameters: protected-branches: - production - staging tracy: bar: - Nofutur3\GitPanel\Diagnostics\Panel(%protected-branches%)
Nette 旧版本
nette: debugger: bar: - Nofutur3\GitPanel\Diagnostics\Panel
独立 Tracy
如果您在没有 Nette 的情况下使用 Tracy,可以通过这种方式添加 GitPanel
\Tracy\Debugger::getBar()->addPanel(new \Nofutur3\GitPanel\Diagnostics\Panel());
或使用受保护的分支
\Tracy\Debugger::getBar() ->addPanel(new \Nofutur3\GitPanel\Diagnostics\Panel(['production','staging']));
支持
💲 您喜欢这个工具吗?请用一些小钱支持我,以支付咖啡费用 ;)