Skip to content

Commit 1076a0f

Browse files
committed
bug #15549 [FrameworkBundle] Fix precedence of xdebug.file_link_format (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] Fix precedence of xdebug.file_link_format | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#5625 See symfony/demo#148 (comment) Commits ------- adb5327 [FrameworkBundle] Fix precedence of xdebug.file_link_format
2 parents 34bbd12 + adb5327 commit 1076a0f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,16 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB
356356
$loader->load('templating.xml');
357357
$loader->load('templating_php.xml');
358358

359-
$links = array(
360-
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
361-
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
362-
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
363-
'sublime' => 'subl://open?url=file://%%f&line=%%l',
364-
);
359+
if (!$container->hasParameter('templating.helper.code.file_link_format')) {
360+
$links = array(
361+
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
362+
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
363+
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
364+
'sublime' => 'subl://open?url=file://%%f&line=%%l',
365+
);
365366

366-
$container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide);
367+
$container->setParameter('templating.helper.code.file_link_format', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: (isset($links[$ide]) ? $links[$ide] : $ide));
368+
}
367369
$container->setParameter('templating.helper.form.resources', $config['form']['resources']);
368370
$container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']);
369371

0 commit comments

Comments
 (0)