From 97e07d5c24d637f50db7ee74bfa48ecd5256a026 Mon Sep 17 00:00:00 2001 From: Nate Bessette Date: Sun, 8 Jun 2014 02:27:59 -0400 Subject: [PATCH] Check for xdebug link format via both ini_get and get_cfg_var --- src/Symfony/Bridge/Twig/Extension/CodeExtension.php | 10 +++++++++- src/Symfony/Component/Debug/ExceptionHandler.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php index 93d99f936c74..01df2ffca707 100644 --- a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php @@ -35,7 +35,15 @@ class CodeExtension extends \Twig_Extension */ public function __construct($fileLinkFormat, $rootDir, $charset) { - $this->fileLinkFormat = empty($fileLinkFormat) ? ini_get('xdebug.file_link_format') : $fileLinkFormat; + if (empty($fileLinkFormat)) { + $fileLinkFormat = ini_get('xdebug.file_link_format'); + + if (empty($fileLinkFormat)) { + $fileLinkFormat = get_cfg_var('xdebug.file_link_format'); + } + } + + $this->fileLinkFormat = $fileLinkFormat; $this->rootDir = str_replace('\\', '/', dirname($rootDir)).'/'; $this->charset = $charset; } diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index f6ec8ddfb3f9..fb1ad9306f79 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -349,7 +349,7 @@ private function formatPath($path, $line) $path = self::utf8Htmlize($path); $file = preg_match('#[^/\\\\]*$#', $path, $file) ? $file[0] : $path; - if ($linkFormat = ini_get('xdebug.file_link_format')) { + if (($linkFormat = ini_get('xdebug.file_link_format')) || ($linkFormat = get_cfg_var('xdebug.file_link_format'))) { $link = str_replace(array('%f', '%l'), array($path, $line), $linkFormat); return sprintf(' in %s line %d', $link, $file, $line);