Skip to content

Commit d23320f

Browse files
committed
feature symfony#11378 Allow xdebug.file_link_format from php ini to work when xdebug extension is not loaded (frickenate, ClementGautier)
This PR was merged into the 2.6-dev branch. Discussion ---------- Allow xdebug.file_link_format from php ini to work when xdebug extension is not loaded Q | A ----------------- | --------------- Bug fix? | yes New feature? | no BC breaks? | no Deprecations? | no Tests pass? | yes Fixed tickets | symfony#11081 License | MIT Doc PR | N/A Complete the PR symfony#11081 Commits ------- 8b2397c Applyied code review 97e07d5 Check for xdebug link format via both ini_get and get_cfg_var
2 parents 1ee4a41 + 8b2397c commit d23320f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bridge/Twig/Extension/CodeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CodeExtension extends \Twig_Extension
3535
*/
3636
public function __construct($fileLinkFormat, $rootDir, $charset)
3737
{
38-
$this->fileLinkFormat = empty($fileLinkFormat) ? ini_get('xdebug.file_link_format') : $fileLinkFormat;
38+
$this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
3939
$this->rootDir = str_replace('\\', '/', dirname($rootDir)).'/';
4040
$this->charset = $charset;
4141
}

src/Symfony/Component/Debug/ExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private function formatPath($path, $line)
349349
$path = self::utf8Htmlize($path);
350350
$file = preg_match('#[^/\\\\]*$#', $path, $file) ? $file[0] : $path;
351351

352-
if ($linkFormat = ini_get('xdebug.file_link_format')) {
352+
if ($linkFormat = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) {
353353
$link = str_replace(array('%f', '%l'), array($path, $line), $linkFormat);
354354

355355
return sprintf(' <a href="%s" title="Go to source">in %s line %d</a>', $link, $file, $line);

0 commit comments

Comments
 (0)