silex/web-profiler

该软件包已被废弃,不再维护。作者建议使用 symfony/web-profiler-bundle 软件包。

Silex 的 WebProfiler

v2.0.11 2018-04-04 11:41 UTC

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
));

提供者依赖于 ServiceControllerServiceProviderTwigServiceProviderHttpFragmentServiceProvider,因此如果尚未启用,您也需要启用这些提供者

$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 中显示安全相关信息。