4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\VarDumper\Dumper;
14 use Symfony\Component\VarDumper\Cloner\Cursor;
15 use Symfony\Component\VarDumper\Cloner\Data;
18 * HtmlDumper dumps variables as HTML.
20 * @author Nicolas Grekas <p@tchwork.com>
22 class HtmlDumper extends CliDumper
24 public static $defaultOutput = 'php://output';
26 protected $dumpHeader;
27 protected $dumpPrefix = '<pre class=sf-dump id=%s data-indent-pad="%s">';
28 protected $dumpSuffix = '</pre><script>Sfdump(%s)</script>';
29 protected $dumpId = 'sf-dump';
30 protected $colors = true;
31 protected $headerIsDumped = false;
32 protected $lastDepth = -1;
33 protected $styles = array(
34 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:99999; word-break: break-all',
35 'num' => 'font-weight:bold; color:#1299DA',
36 'const' => 'font-weight:bold',
37 'str' => 'font-weight:bold; color:#56DB3A',
38 'note' => 'color:#1299DA',
39 'ref' => 'color:#A0A0A0',
40 'public' => 'color:#FFFFFF',
41 'protected' => 'color:#FFFFFF',
42 'private' => 'color:#FFFFFF',
43 'meta' => 'color:#B729D9',
44 'key' => 'color:#56DB3A',
45 'index' => 'color:#1299DA',
46 'ellipsis' => 'color:#FF8400',
49 private $displayOptions = array(
51 'maxStringLength' => 160,
52 'fileLinkFormat' => null,
54 private $extraDisplayOptions = array();
59 public function __construct($output = null, $charset = null, $flags = 0)
61 AbstractDumper::__construct($output, $charset, $flags);
62 $this->dumpId = 'sf-dump-'.mt_rand();
63 $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
69 public function setStyles(array $styles)
71 $this->headerIsDumped = false;
72 $this->styles = $styles + $this->styles;
76 * Configures display options.
78 * @param array $displayOptions A map of display options to customize the behavior
80 public function setDisplayOptions(array $displayOptions)
82 $this->headerIsDumped = false;
83 $this->displayOptions = $displayOptions + $this->displayOptions;
87 * Sets an HTML header that will be dumped once in the output stream.
89 * @param string $header An HTML string
91 public function setDumpHeader($header)
93 $this->dumpHeader = $header;
97 * Sets an HTML prefix and suffix that will encapse every single dump.
99 * @param string $prefix The prepended HTML string
100 * @param string $suffix The appended HTML string
102 public function setDumpBoundaries($prefix, $suffix)
104 $this->dumpPrefix = $prefix;
105 $this->dumpSuffix = $suffix;
111 public function dump(Data $data, $output = null, array $extraDisplayOptions = array())
113 $this->extraDisplayOptions = $extraDisplayOptions;
114 $result = parent::dump($data, $output);
115 $this->dumpId = 'sf-dump-'.mt_rand();
121 * Dumps the HTML header.
123 protected function getDumpHeader()
125 $this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
127 if (null !== $this->dumpHeader) {
128 return $this->dumpHeader;
131 $line = str_replace('{$options}', json_encode($this->displayOptions, JSON_FORCE_OBJECT), <<<'EOHTML'
133 Sfdump = window.Sfdump || (function (doc) {
135 var refStyle = doc.createElement('style'),
136 rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
137 idRx = /\bsf-dump-\d+-ref[012]\w+\b/,
138 keyHint = 0 <= navigator.platform.toUpperCase().indexOf('MAC') ? 'Cmd' : 'Ctrl',
139 addEventListener = function (e, n, cb) {
140 e.addEventListener(n, cb, false);
143 (doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle);
145 if (!doc.addEventListener) {
146 addEventListener = function (element, eventName, callback) {
147 element.attachEvent('on' + eventName, function (e) {
148 e.preventDefault = function () {e.returnValue = false;};
149 e.target = e.srcElement;
155 function toggle(a, recursive) {
156 var s = a.nextSibling || {}, oldClass = s.className, arrow, newClass;
158 if (/\bsf-dump-compact\b/.test(oldClass)) {
160 newClass = 'sf-dump-expanded';
161 } else if (/\bsf-dump-expanded\b/.test(oldClass)) {
163 newClass = 'sf-dump-compact';
168 if (doc.createEvent && s.dispatchEvent) {
169 var event = doc.createEvent('Event');
170 event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false);
172 s.dispatchEvent(event);
175 a.lastChild.innerHTML = arrow;
176 s.className = s.className.replace(/\bsf-dump-(compact|expanded)\b/, newClass);
180 a = s.querySelectorAll('.'+oldClass);
181 for (s = 0; s < a.length; ++s) {
182 if (-1 == a[s].className.indexOf(newClass)) {
183 a[s].className = newClass;
184 a[s].previousSibling.lastChild.innerHTML = arrow;
194 function collapse(a, recursive) {
195 var s = a.nextSibling || {}, oldClass = s.className;
197 if (/\bsf-dump-expanded\b/.test(oldClass)) {
198 toggle(a, recursive);
206 function expand(a, recursive) {
207 var s = a.nextSibling || {}, oldClass = s.className;
209 if (/\bsf-dump-compact\b/.test(oldClass)) {
210 toggle(a, recursive);
218 function collapseAll(root) {
219 var a = root.querySelector('a.sf-dump-toggle');
230 function reveal(node) {
231 var previous, parents = [];
233 while ((node = node.parentNode || {}) && (previous = node.previousSibling) && 'A' === previous.tagName) {
234 parents.push(previous);
237 if (0 !== parents.length) {
238 parents.forEach(function (parent) {
248 function highlight(root, activeNode, nodes) {
249 resetHighlightedNodes(root);
251 Array.from(nodes||[]).forEach(function (node) {
252 if (!/\bsf-dump-highlight\b/.test(node.className)) {
253 node.className = node.className + ' sf-dump-highlight';
257 if (!/\bsf-dump-highlight-active\b/.test(activeNode.className)) {
258 activeNode.className = activeNode.className + ' sf-dump-highlight-active';
262 function resetHighlightedNodes(root) {
263 Array.from(root.querySelectorAll('.sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private')).forEach(function (strNode) {
264 strNode.className = strNode.className.replace(/\bsf-dump-highlight\b/, '');
265 strNode.className = strNode.className.replace(/\bsf-dump-highlight-active\b/, '');
269 return function (root, x) {
270 root = doc.getElementById(root);
272 var indentRx = new RegExp('^('+(root.getAttribute('data-indent-pad') || ' ').replace(rxEsc, '\\$1')+')+', 'm'),
273 options = {$options},
274 elt = root.getElementsByTagName('A'),
279 while (i < len) t.push(elt[i++]);
286 addEventListener(root, e, function (e) {
287 if ('A' == e.target.tagName) {
289 } else if ('A' == e.target.parentNode.tagName) {
290 f(e.target.parentNode, e);
291 } else if (e.target.nextElementSibling && 'A' == e.target.nextElementSibling.tagName) {
292 f(e.target.nextElementSibling, e, true);
296 function isCtrlKey(e) {
297 return e.ctrlKey || e.metaKey;
299 function xpathString(str) {
300 var parts = str.match(/[^'"]+|['"]/g).map(function (part) {
308 return "'" + part + "'";
311 return "concat(" + parts.join(",") + ", '')";
313 addEventListener(root, 'mouseover', function (e) {
314 if ('' != refStyle.innerHTML) {
315 refStyle.innerHTML = '';
318 a('mouseover', function (a, e, c) {
320 e.target.style.cursor = "pointer";
321 } else if (a = idRx.exec(a.className)) {
323 refStyle.innerHTML = 'pre.sf-dump .'+a[0]+'{background-color: #B729D9; color: #FFF !important; border-radius: 2px}';
328 a('click', function (a, e, c) {
329 if (/\bsf-dump-toggle\b/.test(a.className)) {
331 if (!toggle(a, isCtrlKey(e))) {
332 var r = doc.getElementById(a.getAttribute('href').substr(1)),
333 s = r.previousSibling,
336 t.replaceChild(r, a);
337 f.replaceChild(a, s);
338 t.insertBefore(s, r);
339 f = f.firstChild.nodeValue.match(indentRx);
340 t = t.firstChild.nodeValue.match(indentRx);
341 if (f && t && f[0] !== t[0]) {
342 r.innerHTML = r.innerHTML.replace(new RegExp('^'+f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]);
344 if (/\bsf-dump-compact\b/.test(r.className)) {
345 toggle(s, isCtrlKey(e));
350 } else if (doc.getSelection) {
352 doc.getSelection().removeAllRanges();
354 doc.getSelection().empty();
357 doc.selection.empty();
359 } else if (/\bsf-dump-str-toggle\b/.test(a.className)) {
361 e = a.parentNode.parentNode;
362 e.className = e.className.replace(/\bsf-dump-str-(expand|collapse)\b/, a.parentNode.className);
366 elt = root.getElementsByTagName('SAMP');
370 while (i < len) t.push(elt[i++]);
373 for (i = 0; i < len; ++i) {
375 if ('SAMP' == elt.tagName) {
376 a = elt.previousSibling || {};
377 if ('A' != a.tagName) {
378 a = doc.createElement('A');
379 a.className = 'sf-dump-ref';
380 elt.parentNode.insertBefore(a, elt);
384 a.title = (a.title ? a.title+'\n[' : '[')+keyHint+'+click] Expand all children';
385 a.innerHTML += '<span>▼</span>';
386 a.className += ' sf-dump-toggle';
389 if ('sf-dump' != elt.parentNode.className) {
390 x += elt.parentNode.getAttribute('data-depth')/1;
392 elt.setAttribute('data-depth', x);
393 var className = elt.className;
394 elt.className = 'sf-dump-expanded';
395 if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) {
398 } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
400 elt.className += ' '+a;
402 if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {
403 a = a != elt.nextSibling.id && doc.getElementById(a);
407 s.parentNode.insertBefore(a, s);
408 if (/^[@#]/.test(elt.innerHTML)) {
409 elt.innerHTML += ' <span>▶</span>';
411 elt.innerHTML = '<span>▶</span>';
412 elt.className = 'sf-dump-ref';
414 elt.className += ' sf-dump-toggle';
416 if ('&' == elt.innerHTML.charAt(0)) {
418 elt.className = 'sf-dump-ref';
425 if (doc.evaluate && Array.from && root.children.length > 1) {
426 root.setAttribute('tabindex', 0);
428 SearchState = function () {
432 SearchState.prototype = {
434 if (this.isEmpty()) {
435 return this.current();
437 this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0;
439 return this.current();
441 previous: function () {
442 if (this.isEmpty()) {
443 return this.current();
445 this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1);
447 return this.current();
449 isEmpty: function () {
450 return 0 === this.count();
452 current: function () {
453 if (this.isEmpty()) {
456 return this.nodes[this.idx];
463 return this.nodes.length;
467 function showCurrent(state)
469 var currentNode = state.current();
472 highlight(root, currentNode, state.nodes);
474 counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count();
477 var search = doc.createElement('div');
478 search.className = 'sf-dump-search-wrapper sf-dump-search-hidden';
480 <input type="text" class="sf-dump-search-input">
481 <span class="sf-dump-search-count">0 of 0<\/span>
482 <button type="button" class="sf-dump-search-input-previous" tabindex="-1">
483 <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
484 <path d="M1683 1331l-166 165q-19 19-45 19t-45-19l-531-531-531 531q-19 19-45 19t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19 45-19t45 19l742 741q19 19 19 45.5t-19 45.5z"\/>
487 <button type="button" class="sf-dump-search-input-next" tabindex="-1">
488 <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
489 <path d="M1683 808l-742 741q-19 19-45 19t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"\/>
493 root.insertBefore(search, root.firstChild);
495 var state = new SearchState();
496 var searchInput = search.querySelector('.sf-dump-search-input');
497 var counter = search.querySelector('.sf-dump-search-count');
498 var searchInputTimer = 0;
499 var previousSearchQuery = '';
501 addEventListener(searchInput, 'keyup', function (e) {
502 var searchQuery = e.target.value;
503 /* Don't perform anything if the pressed key didn't change the query */
504 if (searchQuery === previousSearchQuery) {
507 previousSearchQuery = searchQuery;
508 clearTimeout(searchInputTimer);
509 searchInputTimer = setTimeout(function () {
512 resetHighlightedNodes(root);
513 if ('' === searchQuery) {
514 counter.textContent = '0 of 0';
519 var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
521 while (node = xpathResult.iterateNext()) state.nodes.push(node);
527 Array.from(search.querySelectorAll('.sf-dump-search-input-next, .sf-dump-search-input-previous')).forEach(function (btn) {
528 addEventListener(btn, 'click', function (e) {
530 -1 !== e.target.className.indexOf('next') ? state.next() : state.previous();
537 addEventListener(root, 'keydown', function (e) {
538 var isSearchActive = !/\bsf-dump-search-hidden\b/.test(search.className);
539 if ((114 === e.keyCode && !isSearchActive) || (isCtrlKey(e) && 70 === e.keyCode)) {
540 /* F3 or CMD/CTRL + F */
542 search.className = search.className.replace(/\bsf-dump-search-hidden\b/, '');
544 } else if (isSearchActive) {
545 if (27 === e.keyCode) {
547 search.className += ' sf-dump-search-hidden';
549 resetHighlightedNodes(root);
550 searchInput.value = '';
552 (isCtrlKey(e) && 71 === e.keyCode) /* CMD/CTRL + G */
553 || 13 === e.keyCode /* Enter */
554 || 114 === e.keyCode /* F3 */
557 e.shiftKey ? state.previous() : state.next();
565 if (0 >= options.maxStringLength) {
569 elt = root.querySelectorAll('.sf-dump-str');
574 while (i < len) t.push(elt[i++]);
577 for (i = 0; i < len; ++i) {
579 s = elt.innerText || elt.textContent;
580 x = s.length - options.maxStringLength;
583 elt[elt.innerText ? 'innerText' : 'textContent'] = s.substring(0, options.maxStringLength);
584 elt.className += ' sf-dump-str-collapse';
585 elt.innerHTML = '<span class=sf-dump-str-collapse>'+h+'<a class="sf-dump-ref sf-dump-str-toggle" title="Collapse"> ◀</a></span>'+
586 '<span class=sf-dump-str-expand>'+elt.innerHTML+'<a class="sf-dump-ref sf-dump-str-toggle" title="'+x+' remaining characters"> ▶</a></span>';
610 pre.sf-dump .sf-dump-compact {
614 text-decoration: none;
619 text-decoration: none;
625 pre.sf-dump .sf-dump-ellipsis {
626 display: inline-block;
628 text-overflow: ellipsis;
634 pre.sf-dump .sf-dump-ellipsis+.sf-dump-ellipsis {
642 .sf-dump-str-collapse .sf-dump-str-collapse {
645 .sf-dump-str-expand .sf-dump-str-expand {
648 .sf-dump-public.sf-dump-highlight,
649 .sf-dump-protected.sf-dump-highlight,
650 .sf-dump-private.sf-dump-highlight,
651 .sf-dump-str.sf-dump-highlight,
652 .sf-dump-key.sf-dump-highlight {
653 background: rgba(111, 172, 204, 0.3);
654 border: 1px solid #7DA0B1;
657 .sf-dump-public.sf-dump-highlight-active,
658 .sf-dump-protected.sf-dump-highlight-active,
659 .sf-dump-private.sf-dump-highlight-active,
660 .sf-dump-str.sf-dump-highlight-active,
661 .sf-dump-key.sf-dump-highlight-active {
662 background: rgba(253, 175, 0, 0.4);
663 border: 1px solid #ffa500;
666 pre.sf-dump .sf-dump-search-hidden {
669 pre.sf-dump .sf-dump-search-wrapper {
676 pre.sf-dump .sf-dump-search-wrapper > * {
678 box-sizing: border-box;
684 border: 1px solid #BBB;
686 pre.sf-dump .sf-dump-search-wrapper > input.sf-dump-search-input {
692 border-top-left-radius: 3px;
693 border-bottom-left-radius: 3px;
696 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next,
697 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous {
704 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next {
705 border-top-right-radius: 3px;
706 border-bottom-right-radius: 3px;
708 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next > svg,
709 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous > svg {
710 pointer-events: none;
714 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-count {
715 display: inline-block;
725 foreach ($this->styles as $class => $style) {
726 $line .= 'pre.sf-dump'.('default' === $class ? ', pre.sf-dump' : '').' .sf-dump-'.$class.'{'.$style.'}';
729 return $this->dumpHeader = preg_replace('/\s+/', ' ', $line).'</style>'.$this->dumpHeader;
735 public function enterHash(Cursor $cursor, $type, $class, $hasChild)
737 parent::enterHash($cursor, $type, $class, false);
739 if ($cursor->skipChildren) {
740 $cursor->skipChildren = false;
741 $eol = ' class=sf-dump-compact>';
742 } elseif ($this->expandNextHash) {
743 $this->expandNextHash = false;
744 $eol = ' class=sf-dump-expanded>';
750 $this->line .= '<samp';
751 if ($cursor->refIndex) {
752 $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
753 $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
755 $this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r);
758 $this->dumpLine($cursor->depth);
765 public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut)
767 $this->dumpEllipsis($cursor, $hasChild, $cut);
769 $this->line .= '</samp>';
771 parent::leaveHash($cursor, $type, $class, $hasChild, 0);
777 protected function style($style, $value, $attr = array())
785 if ('ref' === $style) {
786 if (empty($attr['count'])) {
787 return sprintf('<a class=sf-dump-ref>%s</a>', $v);
789 $r = ('#' !== $v[0] ? 1 - ('@' !== $v[0]) : 2).substr($value, 1);
791 return sprintf('<a class=sf-dump-ref href=#%s-ref%s title="%d occurrences">%s</a>', $this->dumpId, $r, 1 + $attr['count'], $v);
794 if ('const' === $style && isset($attr['value'])) {
795 $style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
796 } elseif ('public' === $style) {
797 $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
798 } elseif ('str' === $style && 1 < $attr['length']) {
799 $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
800 } elseif ('note' === $style && false !== $c = strrpos($v, '\\')) {
801 return sprintf('<abbr title="%s" class=sf-dump-%s>%s</abbr>', $v, $style, substr($v, $c + 1));
802 } elseif ('protected' === $style) {
803 $style .= ' title="Protected property"';
804 } elseif ('meta' === $style && isset($attr['title'])) {
805 $style .= sprintf(' title="%s"', esc($this->utf8Encode($attr['title'])));
806 } elseif ('private' === $style) {
807 $style .= sprintf(' title="Private property defined in class: `%s`"', esc($this->utf8Encode($attr['class'])));
809 $map = static::$controlCharsMap;
811 if (isset($attr['ellipsis'])) {
812 $class = 'sf-dump-ellipsis';
813 if (isset($attr['ellipsis-type'])) {
814 $class = sprintf('"%s sf-dump-ellipsis-%s"', $class, $attr['ellipsis-type']);
816 $label = esc(substr($value, -$attr['ellipsis']));
817 $style = str_replace(' title="', " title=\"$v\n", $style);
818 $v = sprintf('<span class=%s>%s</span>', $class, substr($v, 0, -strlen($label)));
820 if (!empty($attr['ellipsis-tail'])) {
821 $tail = strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail'])));
822 $v .= sprintf('<span class=sf-dump-ellipsis>%s</span>%s', substr($label, 0, $tail), substr($label, $tail));
828 $v = "<span class=sf-dump-{$style}>".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) {
829 $s = '<span class=sf-dump-default>';
832 $s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', ord($c[$i]));
833 } while (isset($c[++$i]));
838 if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) {
839 $attr['href'] = $href;
841 if (isset($attr['href'])) {
842 $target = isset($attr['file']) ? '' : ' target="_blank"';
843 $v = sprintf('<a href="%s"%s rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $target, $v);
845 if (isset($attr['lang'])) {
846 $v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v);
855 protected function dumpLine($depth, $endOfValue = false)
857 if (-1 === $this->lastDepth) {
858 $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line;
860 if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) {
861 $this->line = $this->getDumpHeader().$this->line;
865 $args = array('"'.$this->dumpId.'"');
866 if ($this->extraDisplayOptions) {
867 $args[] = json_encode($this->extraDisplayOptions, JSON_FORCE_OBJECT);
870 $this->line .= sprintf(str_replace('"%s"', '%s', $this->dumpSuffix), implode(', ', $args));
872 $this->lastDepth = $depth;
874 $this->line = mb_convert_encoding($this->line, 'HTML-ENTITIES', 'UTF-8');
877 AbstractDumper::dumpLine(0);
879 AbstractDumper::dumpLine($depth);
882 private function getSourceLink($file, $line)
884 $options = $this->extraDisplayOptions + $this->displayOptions;
886 if ($fmt = $options['fileLinkFormat']) {
887 return is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line);
896 return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');