Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2faaf11

Browse files
bug #26626 [WebProfilerBundle] use the router to resolve file links (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
2 parents 723d26f + 2cfc573 commit 2faaf11

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,20 @@
5656
<argument>%debug.file_link_format%</argument>
5757
<argument type="service" id="request_stack" on-invalid="ignore" />
5858
<argument>%kernel.project_dir%</argument>
59-
<argument>/_profiler/open?file=%%f&amp;line=%%l#line%%l</argument>
59+
<argument type="service">
60+
<service class="string">
61+
<factory function="implode" />
62+
<argument type="collection">
63+
<argument type="service">
64+
<service class="string">
65+
<factory service="router" method="generate" />
66+
<argument>_profiler_open_file</argument>
67+
</service>
68+
</argument>
69+
<argument>?file=%%f&amp;line=%%l#line%%l</argument>
70+
</argument>
71+
</service>
72+
</argument>
6073
</service>
6174
</services>
6275
</container>

src/Symfony/Component/Routing/Router.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ function (ConfigCacheInterface $cache) {
302302
}
303303
);
304304

305-
require_once $cache->getPath();
305+
if (!class_exists($this->options['matcher_cache_class'], false)) {
306+
require_once $cache->getPath();
307+
}
306308

307309
return $this->matcher = new $this->options['matcher_cache_class']($this->context);
308310
}
@@ -334,7 +336,9 @@ function (ConfigCacheInterface $cache) {
334336
}
335337
);
336338

337-
require_once $cache->getPath();
339+
if (!class_exists($this->options['generator_cache_class'], false)) {
340+
require_once $cache->getPath();
341+
}
338342

339343
$this->generator = new $this->options['generator_cache_class']($this->context, $this->logger);
340344
}

0 commit comments

Comments
 (0)