分析器配置参考 (WebProfilerBundle)
WebProfilerBundle 是一个 开发工具,它提供关于每次请求执行的详细技术信息,并在 Web 调试工具栏和 分析器 中显示。所有这些选项都在你的应用配置中的 web_profiler
键下配置。
1 2 3 4 5
# displays the default config values defined by Symfony
$ php bin/console config:dump-reference web_profiler
# displays the actual config values used by your application
$ php bin/console debug:config web_profiler
注意
当使用 XML 时,你必须使用 http://symfony.ac.cn/schema/dic/webprofiler
命名空间,相关的 XSD 模式可在以下位置找到:http://symfony.ac.cn/schema/dic/webprofiler/webprofiler-1.0.xsd
警告
Web 调试工具栏不适用于 StreamedResponse
类型的响应。
配置
excluded_ajax_paths
类型: string
默认值: ^/((index|app(_[\w]+)?)\.php/)?_wdt
当工具栏记录 AJAX 请求时,它会将其 URL 与此正则表达式匹配。如果 URL 匹配,则请求不会显示在工具栏中。当应用程序发出大量 AJAX 请求,或者它们很重并且你想排除其中一些请求时,这非常有用。
intercept_redirects
类型: boolean
默认值: false
如果在 HTTP 响应期间发生重定向,浏览器会自动跟随它,你将看不到原始 URL 的工具栏或分析器,只能看到重定向的 URL。
当将此选项设置为 true
时,浏览器会在进行任何重定向之前停止,并向你显示将要重定向到的 URL、其工具栏和分析器。一旦你检查了工具栏/分析器数据,你可以点击给定的链接来执行重定向。
本作品,包括代码示例,根据 Creative Commons BY-SA 3.0 许可协议获得许可。