Commit 4d9dc04
committed
bug symfony#59515 [FrameworkBundle] Fix wiring ConsoleProfilerListener (nicolas-grekas)
This PR was merged into the 6.4 branch.
Discussion
----------
[FrameworkBundle] Fix wiring ConsoleProfilerListener
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
At the moment, when cache:clear is called, the profiler is instantiated, with all its data collectors.
When one of them needs an env var to be constructed, 💥
But this should not happen in the first place: command profiling is an opt-in feature. Nothing related should be instantiated unless asked to do so.
The issue happens because service registration doesn't take care of not using the profiler unless really needed.
This fixes it by:
1. not using the profiler to "disable" it
2. injecting a lazy profiler service so that it's instantiated only when actually required
Commits
-------
45763bd [FrameworkBundle] Fix wiring ConsoleProfilerListenerFile tree
2 files changed
+16
-5
lines changed- src/Symfony/Bundle/FrameworkBundle
- EventListener
- Resources/config
2 files changed
+16
-5
lines changedLines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
117 | | - | |
118 | | - | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| |||
0 commit comments