@@ -90,6 +90,21 @@ public function load(array $configs, ContainerBuilder $container)
90
90
$ container ->setParameter ('kernel.trusted_proxies ' , $ config ['trusted_proxies ' ]);
91
91
$ container ->setParameter ('kernel.default_locale ' , $ config ['default_locale ' ]);
92
92
93
+ if (!$ container ->hasParameter ('debug.file_link_format ' )) {
94
+ if (!$ container ->hasParameter ('templating.helper.code.file_link_format ' )) {
95
+ $ links = array (
96
+ 'textmate ' => 'txmt://open?url=file://%%f&line=%%l ' ,
97
+ 'macvim ' => 'mvim://open?url=file://%%f&line=%%l ' ,
98
+ 'emacs ' => 'emacs://open?url=file://%%f&line=%%l ' ,
99
+ 'sublime ' => 'subl://open?url=file://%%f&line=%%l ' ,
100
+ );
101
+ $ ide = $ config ['ide ' ];
102
+
103
+ $ container ->setParameter ('templating.helper.code.file_link_format ' , str_replace ('% ' , '%% ' , ini_get ('xdebug.file_link_format ' ) ?: get_cfg_var ('xdebug.file_link_format ' )) ?: (isset ($ links [$ ide ]) ? $ links [$ ide ] : $ ide ));
104
+ }
105
+ $ container ->setParameter ('debug.file_link_format ' , '%templating.helper.code.file_link_format% ' );
106
+ }
107
+
93
108
if (!empty ($ config ['test ' ])) {
94
109
$ loader ->load ('test.xml ' );
95
110
}
@@ -120,7 +135,7 @@ public function load(array $configs, ContainerBuilder $container)
120
135
}
121
136
122
137
if ($ this ->isConfigEnabled ($ container , $ config ['templating ' ])) {
123
- $ this ->registerTemplatingConfiguration ($ config ['templating ' ], $ config [ ' ide ' ], $ container , $ loader );
138
+ $ this ->registerTemplatingConfiguration ($ config ['templating ' ], $ container , $ loader );
124
139
}
125
140
126
141
$ this ->registerValidationConfiguration ($ config ['validation ' ], $ container , $ loader );
@@ -431,11 +446,6 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
431
446
}
432
447
433
448
$ definition ->replaceArgument (4 , $ debug );
434
-
435
- if ($ container ->hasParameter ('templating.helper.code.file_link_format ' )) {
436
- $ definition ->replaceArgument (5 , '%templating.helper.code.file_link_format% ' );
437
- }
438
-
439
449
$ definition ->replaceArgument (6 , $ debug );
440
450
}
441
451
@@ -553,25 +563,13 @@ private function registerRequestConfiguration(array $config, ContainerBuilder $c
553
563
* Loads the templating configuration.
554
564
*
555
565
* @param array $config A templating configuration array
556
- * @param string $ide
557
566
* @param ContainerBuilder $container A ContainerBuilder instance
558
567
* @param XmlFileLoader $loader An XmlFileLoader instance
559
568
*/
560
- private function registerTemplatingConfiguration (array $ config , $ ide , ContainerBuilder $ container , XmlFileLoader $ loader )
569
+ private function registerTemplatingConfiguration (array $ config , ContainerBuilder $ container , XmlFileLoader $ loader )
561
570
{
562
571
$ loader ->load ('templating.xml ' );
563
572
564
- if (!$ container ->hasParameter ('templating.helper.code.file_link_format ' )) {
565
- $ links = array (
566
- 'textmate ' => 'txmt://open?url=file://%%f&line=%%l ' ,
567
- 'macvim ' => 'mvim://open?url=file://%%f&line=%%l ' ,
568
- 'emacs ' => 'emacs://open?url=file://%%f&line=%%l ' ,
569
- 'sublime ' => 'subl://open?url=file://%%f&line=%%l ' ,
570
- );
571
-
572
- $ container ->setParameter ('templating.helper.code.file_link_format ' , str_replace ('% ' , '%% ' , ini_get ('xdebug.file_link_format ' ) ?: get_cfg_var ('xdebug.file_link_format ' )) ?: (isset ($ links [$ ide ]) ? $ links [$ ide ] : $ ide ));
573
- }
574
-
575
573
$ container ->setParameter ('fragment.renderer.hinclude.global_template ' , $ config ['hinclude_default_template ' ]);
576
574
577
575
if ($ container ->getParameter ('kernel.debug ' )) {
0 commit comments