silexandfriends / web-profiler
Silex 的 WebProfiler
Requires
- silexandfriends/silex: ^2.0
- symfony/stopwatch: ^4.0
- symfony/twig-bridge: ^4.0
- symfony/twig-bundle: ^4.0
- symfony/web-profiler-bundle: ^4.0
Requires (Dev)
- symfony/browser-kit: ^4.0
- symfony/css-selector: ^4.0
- symfony/debug-bundle: ^4.0
- symfony/phpunit-bridge: ^4.0
- symfony/security: ^4.0
- symfony/security-bundle: ^4.0
- symfony/translation: ^4.0
Conflicts
- symfony/web-profiler-bundle: 3.1.0
Replaces
- silex/web-profiler: v2.1
README
警告: Silex 仅处于维护模式。生命周期截止到 2018 年 6 月。更多信息请参阅 Symfony 的博客.
Silex Web Profiler 服务提供者允许你在 Silex 2.x 应用程序中使用出色的 Symfony Web 调试工具栏和 Symfony Profiler。
注意
如果你使用的是 1.x 版本的 Silex,请参阅 特定文档.
要安装此库,请运行以下命令,并将获得最新版本
composer require 'silex/web-profiler:^2.0'
并在你的应用程序中启用它
use Silex\Provider; $app->register(new Provider\WebProfilerServiceProvider(), array( 'profiler.cache_dir' => __DIR__.'/../cache/profiler', 'profiler.mount_prefix' => '/_profiler', // this is the default ));
该提供者依赖于 ServiceControllerServiceProvider
、TwigServiceProvider
和 HttpFragmentServiceProvider
,因此如果尚未启用,你也需要启用这些
$app->register(new Provider\HttpFragmentServiceProvider()); $app->register(new Provider\ServiceControllerServiceProvider()); $app->register(new Provider\TwigServiceProvider());
如果你使用 FormServiceProvider
,则 WebProfilerServiceProvider
将检测到并启用相应的面板。
请确保在 WebProfilerServiceProvider
之前注册所有其他必需或使用的服务提供者。
如果你使用 MonologServiceProvider
进行日志记录,你还必须在 Composer 依赖项中添加 symfony/monolog-bridge
以在 Profiler 中获取日志。
如果你使用 VarDumperServiceProvider
,你必须将 symfony/debug-bundle
添加为 Composer 依赖项,以便在工具栏和 Profiler 中显示 VarDumper 输出。
如果你使用 symfony/security
,你还必须将 symfony/security-bundle
添加为 Composer 依赖项,以便在工具栏和 Profiler 中显示与安全相关的信息。