-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] use the router to resolve file links #26626
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
[WebProfilerBundle] use the router to resolve file links #26626
Conversation
nicolas-grekas
commented
Mar 21, 2018
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #22290, #25886 |
License | MIT |
Doc PR | - |
<argument>?file=%%f&line=%%l#line%%l</argument> | ||
</argument> | ||
</service> | ||
</argument> |
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 generates the following code, which is exactly what we need here:
new \Symfony\Component\HttpKernel\Debug\FileLinkFormatter(NULL, ($this->services['request_stack'] ?? $this->services['request_stack'] = new \Symfony\Component\HttpFoundation\RequestStack()), $this->targetDirs[3], \implode(array(0 => ($this->services['router'] ?? $this->getRouterService())->generate('_profiler_open_file'), 1 => '?file=%f&line=%l#line%l')));
@@ -56,7 +56,20 @@ | |||
<argument>%debug.file_link_format%</argument> | |||
<argument type="service" id="request_stack" on-invalid="ignore" /> | |||
<argument>%kernel.project_dir%</argument> | |||
<argument>/_profiler/open?file=%%f&line=%%l#line%%l</argument> | |||
<argument type="service"> | |||
<service class="string"> |
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.
nice hack!
<argument>/_profiler/open?file=%%f&line=%%l#line%%l</argument> | ||
<argument type="service"> | ||
<service class="string"> | ||
<factory function="implode" /> |
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.
oh, and yet another nice hack!
Well done :)
@nicolas-grekas my head exploded when trying to understand this ... but I'm glad this is working 🎉 However, the main concern of Fabien in the other PR (see #24153 (comment)) was the configurability of this. So, can you please paste an example of the config needed if the user wants to customize the URL? We'd need it to update the docs. Thanks! |
@javiereguiluz there is no config needed, the URL will be generated based on the path of the |
…nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [WebProfilerBundle] use the router to resolve file links | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22290, #25886 | License | MIT | Doc PR | - Commits ------- 2cfc573 [WebProfilerBundle] use the router to resolve file links
It creates a BC break as router tries to generate route on container dumping.
We have routes in database and at the end database is checked on container generation (cache:clear command) |
Same here with
The 'ci' environment loads the |
Shall we revert? |
It depends on the time we want, fix in progress, could be ready tomorrow. |
Fix in #26758 |