-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Profiler activation #7859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profiler activation #7859
Conversation
@@ -39,6 +39,10 @@ class WebProfilerExtension extends Extension | |||
*/ | |||
public function load(array $configs, ContainerBuilder $container) | |||
{ | |||
if (!$container->hasParameter('profiler.class')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would break if FrameworkBundle is registered after WebProfilerBundle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I have not changed this part of the old PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed now
Before: enabled: true # the profiler is enabled and data are collected enabled: false # the profiler is enabled but data are not collected (data can be collected on demand) No way to disable the profiler After: enabled: true # the profiler is enabled and data are collected collect: true enabled: true # the profiler is enabled but data are not collected (data can be collected on demand) collect: false enabled: false # the profiler is disabled
This PR was merged into the master branch. Discussion ---------- Profiler activation | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7064, #7071 | License | MIT | Doc PR | symfony/symfony-docs#2565 As stated in #7071, there is no way to disable the profiler completely. Even when the `enabled` flag is set to `false`, the profiler is still registered but the data collectors are not activated. Now, when `enabled` is `false`, the profiler is disabled. To get the old `false` behavior, you now need to set `enabled` to `true` and set the new `collect` flag to `false`. Todo: - [x] update docs - [x] update Symfony SE -- not needed Commits ------- 88ebd62 fixed 8000 the registration of the web profiler when the profiler is disabled a11f901 [FrameworkBundle] added a way to disable the profiler f675dd8 Truly disabled profiler in prod
What is the use-case for an enabled profiler that does not collect any data? |
@Tobion enabling it only for some uri (with a request matcher) or enablign it only for some tests of the testsuite instead of all of them (to make the functional testsuite faster) |
As stated in #7071, there is no way to disable the profiler completely. Even when the
enabled
flag is set tofalse
, the profiler is still registered but the data collectors are not activated.Now, when
enabled
isfalse
, the profiler is disabled. To get the oldfalse
behavior, you now need to setenabled
totrue
and set the newcollect
flag tofalse
.Todo: