Skip to content

Commit

Permalink
merged branch chEbba/xdebug_file_link_format (PR #1927)
Browse files Browse the repository at this point in the history
Commits
-------

cc098a3 [HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler.php

Discussion
----------

[HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler

Format file and line as url, if xdebug.file_link_format is set. Inspired by #1893
  • Loading branch information
fabpot committed Aug 27, 2011
2 parents 07a56ed + cc098a3 commit a746055
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php
Expand Up @@ -115,7 +115,12 @@ private function getContent($exception)
$content .= sprintf('at %s%s%s()', $this->abbrClass($trace['class']), $trace['type'], $trace['function']);
}
if (isset($trace['file']) && isset($trace['line'])) {
$content .= sprintf(' in %s line %s', $trace['file'], $trace['line']);
if ($linkFormat = ini_get('xdebug.file_link_format')) {
$link = str_replace(array('%f', '%l'), array($trace['file'], $trace['line']), $linkFormat);
$content .= sprintf(' in <a href="%s" title="Go to source">%s line %s</a>', $link, $trace['file'], $trace['line']);
} else {
$content .= sprintf(' in %s line %s', $trace['file'], $trace['line']);
}
}
$content .= '</li>';
}
Expand Down

0 comments on commit a746055

Please sign in to comment.