Commit c0fc671
committed
minor #17809 Update "Web debug toolbar" profiler docs (florimondmanca)
This PR was merged into the 5.4 branch.
Discussion
----------
Update "Web debug toolbar" profiler docs
Hello,
I believe I encountered the situation than symfony/symfony#42439
The current [docs](https://symfony.com/doc/current/profiler.html#updating-the-web-debug-toolbar-after-ajax-requests) on updating the Web debug toolbar after XHR requests suggest to use `$event->getKernel()->isDebug()`.
I am using Symfony 6.2, and this results in an attribute error on `isDebug()`. This seems to be because `getKernel()` returns an object that implements `HttpKernelInterface`, which does not define `isDebug()`. However, this method is available on `KernelInterace`.
I was able to get the intended behavior by injecting the kernel via the constructor, as shown in this documentation update proposal.
I checked as follows:
* Run the app with `APP_ENV=dev`. The toolbar shows up and I can see `Symfony-Debug-Toolbar-Replace: 1` in the XHR requests (I'm using [Turbo Frames](https://turbo.hotwired.dev/handbook/frames))
* Run with `APP_ENV=prod`. The toolbar doesn't show up, _and_ I cannot see `Symfony-Debug-Toolbar-Replace: 1` in the XHR requests anymore.
I am targeting `5.4` as the base branch as per the contribution guidelines, given that it should be possible to inject the `KernelInterface` in Symfony 5.4 as well.
Commits
-------
e8cc35d Update "Web debug toolbar" profiler docs1 file changed
+23
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
196 | 198 | | |
| 199 | + | |
197 | 200 | | |
198 | 201 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
204 | 207 | | |
| 208 | + | |
| 209 | + | |
205 | 210 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
210 | 216 | | |
211 | | - | |
212 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
213 | 225 | | |
214 | 226 | | |
215 | 227 | | |
| |||
0 commit comments