|
26 | 26 | class DumpDataCollector extends DataCollector implements DataDumperInterface
|
27 | 27 | {
|
28 | 28 | private $stopwatch;
|
| 29 | + private $fileLinkFormat; |
29 | 30 | private $dataCount = 0;
|
30 | 31 | private $isCollected = true;
|
31 | 32 | private $clonesCount = 0;
|
32 | 33 | private $clonesIndex = 0;
|
33 | 34 | private $rootRefs;
|
34 | 35 |
|
35 |
| - public function __construct(Stopwatch $stopwatch = null) |
| 36 | + public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null) |
36 | 37 | {
|
37 | 38 | $this->stopwatch = $stopwatch;
|
| 39 | + $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); |
38 | 40 |
|
39 | 41 | // All clones share these properties by reference:
|
40 | 42 | $this->rootRefs = array(
|
@@ -213,7 +215,12 @@ public function __destruct()
|
213 | 215 | $dump['name'] = htmlspecialchars($dump['name'], ENT_QUOTES, 'UTF-8');
|
214 | 216 | $dump['file'] = htmlspecialchars($dump['file'], ENT_QUOTES, 'UTF-8');
|
215 | 217 | if ('' !== $dump['file']) {
|
216 |
| - $dump['name'] = "<abbr title=\"{$dump['file']}\">{$dump['name']}</abbr>"; |
| 218 | + if ($this->fileLinkFormat) { |
| 219 | + $link = strtr($this->fileLinkFormat, array('%f' => $dump['file'], '%l' => $dump['line'])); |
| 220 | + $dump['name'] = sprintf('<a href="%s" title="%s">%s</a>', $link, $dump['file'], $dump['name']); |
| 221 | + } else { |
| 222 | + $dump['name'] = sprintf('<abbr title="%s">%s</abbr>', $dump['file'], $dump['name']); |
| 223 | + } |
217 | 224 | }
|
218 | 225 | echo "\n<span class=\"sf-dump-meta\">{$dump['name']} on line {$dump['line']}:</span>";
|
219 | 226 | } else {
|
|
0 commit comments