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 function xpathHasClass(className) {
314 return "contains(concat(' ', normalize-space(@class), ' '), ' " + className +" ')";
316 addEventListener(root, 'mouseover', function (e) {
317 if ('' != refStyle.innerHTML) {
318 refStyle.innerHTML = '';
321 a('mouseover', function (a, e, c) {
323 e.target.style.cursor = "pointer";
324 } else if (a = idRx.exec(a.className)) {
326 refStyle.innerHTML = 'pre.sf-dump .'+a[0]+'{background-color: #B729D9; color: #FFF !important; border-radius: 2px}';
331 a('click', function (a, e, c) {
332 if (/\bsf-dump-toggle\b/.test(a.className)) {
334 if (!toggle(a, isCtrlKey(e))) {
335 var r = doc.getElementById(a.getAttribute('href').substr(1)),
336 s = r.previousSibling,
339 t.replaceChild(r, a);
340 f.replaceChild(a, s);
341 t.insertBefore(s, r);
342 f = f.firstChild.nodeValue.match(indentRx);
343 t = t.firstChild.nodeValue.match(indentRx);
344 if (f && t && f[0] !== t[0]) {
345 r.innerHTML = r.innerHTML.replace(new RegExp('^'+f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]);
347 if (/\bsf-dump-compact\b/.test(r.className)) {
348 toggle(s, isCtrlKey(e));
353 } else if (doc.getSelection) {
355 doc.getSelection().removeAllRanges();
357 doc.getSelection().empty();
360 doc.selection.empty();
362 } else if (/\bsf-dump-str-toggle\b/.test(a.className)) {
364 e = a.parentNode.parentNode;
365 e.className = e.className.replace(/\bsf-dump-str-(expand|collapse)\b/, a.parentNode.className);
369 elt = root.getElementsByTagName('SAMP');
373 while (i < len) t.push(elt[i++]);
376 for (i = 0; i < len; ++i) {
378 if ('SAMP' == elt.tagName) {
379 a = elt.previousSibling || {};
380 if ('A' != a.tagName) {
381 a = doc.createElement('A');
382 a.className = 'sf-dump-ref';
383 elt.parentNode.insertBefore(a, elt);
387 a.title = (a.title ? a.title+'\n[' : '[')+keyHint+'+click] Expand all children';
388 a.innerHTML += '<span>▼</span>';
389 a.className += ' sf-dump-toggle';
392 if ('sf-dump' != elt.parentNode.className) {
393 x += elt.parentNode.getAttribute('data-depth')/1;
395 elt.setAttribute('data-depth', x);
396 var className = elt.className;
397 elt.className = 'sf-dump-expanded';
398 if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) {
401 } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
403 elt.className += ' '+a;
405 if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {
406 a = a != elt.nextSibling.id && doc.getElementById(a);
410 s.parentNode.insertBefore(a, s);
411 if (/^[@#]/.test(elt.innerHTML)) {
412 elt.innerHTML += ' <span>▶</span>';
414 elt.innerHTML = '<span>▶</span>';
415 elt.className = 'sf-dump-ref';
417 elt.className += ' sf-dump-toggle';
419 if ('&' == elt.innerHTML.charAt(0)) {
421 elt.className = 'sf-dump-ref';
428 if (doc.evaluate && Array.from && root.children.length > 1) {
429 root.setAttribute('tabindex', 0);
431 SearchState = function () {
435 SearchState.prototype = {
437 if (this.isEmpty()) {
438 return this.current();
440 this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0;
442 return this.current();
444 previous: function () {
445 if (this.isEmpty()) {
446 return this.current();
448 this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1);
450 return this.current();
452 isEmpty: function () {
453 return 0 === this.count();
455 current: function () {
456 if (this.isEmpty()) {
459 return this.nodes[this.idx];
466 return this.nodes.length;
470 function showCurrent(state)
472 var currentNode = state.current();
475 highlight(root, currentNode, state.nodes);
477 counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count();
480 var search = doc.createElement('div');
481 search.className = 'sf-dump-search-wrapper sf-dump-search-hidden';
483 <input type="text" class="sf-dump-search-input">
484 <span class="sf-dump-search-count">0 of 0<\/span>
485 <button type="button" class="sf-dump-search-input-previous" tabindex="-1">
486 <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
487 <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"\/>
490 <button type="button" class="sf-dump-search-input-next" tabindex="-1">
491 <svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
492 <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"\/>
496 root.insertBefore(search, root.firstChild);
498 var state = new SearchState();
499 var searchInput = search.querySelector('.sf-dump-search-input');
500 var counter = search.querySelector('.sf-dump-search-count');
501 var searchInputTimer = 0;
502 var previousSearchQuery = '';
504 addEventListener(searchInput, 'keyup', function (e) {
505 var searchQuery = e.target.value;
506 /* Don't perform anything if the pressed key didn't change the query */
507 if (searchQuery === previousSearchQuery) {
510 previousSearchQuery = searchQuery;
511 clearTimeout(searchInputTimer);
512 searchInputTimer = setTimeout(function () {
515 resetHighlightedNodes(root);
516 if ('' === searchQuery) {
517 counter.textContent = '0 of 0';
528 ].map(xpathHasClass).join(' or ');
530 var xpathResult = doc.evaluate('.//span[' + classMatches + '][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
532 while (node = xpathResult.iterateNext()) state.nodes.push(node);
538 Array.from(search.querySelectorAll('.sf-dump-search-input-next, .sf-dump-search-input-previous')).forEach(function (btn) {
539 addEventListener(btn, 'click', function (e) {
541 -1 !== e.target.className.indexOf('next') ? state.next() : state.previous();
548 addEventListener(root, 'keydown', function (e) {
549 var isSearchActive = !/\bsf-dump-search-hidden\b/.test(search.className);
550 if ((114 === e.keyCode && !isSearchActive) || (isCtrlKey(e) && 70 === e.keyCode)) {
551 /* F3 or CMD/CTRL + F */
553 search.className = search.className.replace(/\bsf-dump-search-hidden\b/, '');
555 } else if (isSearchActive) {
556 if (27 === e.keyCode) {
558 search.className += ' sf-dump-search-hidden';
560 resetHighlightedNodes(root);
561 searchInput.value = '';
563 (isCtrlKey(e) && 71 === e.keyCode) /* CMD/CTRL + G */
564 || 13 === e.keyCode /* Enter */
565 || 114 === e.keyCode /* F3 */
568 e.shiftKey ? state.previous() : state.next();
576 if (0 >= options.maxStringLength) {
580 elt = root.querySelectorAll('.sf-dump-str');
585 while (i < len) t.push(elt[i++]);
588 for (i = 0; i < len; ++i) {
590 s = elt.innerText || elt.textContent;
591 x = s.length - options.maxStringLength;
594 elt[elt.innerText ? 'innerText' : 'textContent'] = s.substring(0, options.maxStringLength);
595 elt.className += ' sf-dump-str-collapse';
596 elt.innerHTML = '<span class=sf-dump-str-collapse>'+h+'<a class="sf-dump-ref sf-dump-str-toggle" title="Collapse"> ◀</a></span>'+
597 '<span class=sf-dump-str-expand>'+elt.innerHTML+'<a class="sf-dump-ref sf-dump-str-toggle" title="'+x+' remaining characters"> ▶</a></span>';
621 pre.sf-dump .sf-dump-compact {
625 text-decoration: none;
630 text-decoration: none;
636 pre.sf-dump .sf-dump-ellipsis {
637 display: inline-block;
639 text-overflow: ellipsis;
645 pre.sf-dump .sf-dump-ellipsis+.sf-dump-ellipsis {
653 .sf-dump-str-collapse .sf-dump-str-collapse {
656 .sf-dump-str-expand .sf-dump-str-expand {
659 .sf-dump-public.sf-dump-highlight,
660 .sf-dump-protected.sf-dump-highlight,
661 .sf-dump-private.sf-dump-highlight,
662 .sf-dump-str.sf-dump-highlight,
663 .sf-dump-key.sf-dump-highlight {
664 background: rgba(111, 172, 204, 0.3);
665 border: 1px solid #7DA0B1;
668 .sf-dump-public.sf-dump-highlight-active,
669 .sf-dump-protected.sf-dump-highlight-active,
670 .sf-dump-private.sf-dump-highlight-active,
671 .sf-dump-str.sf-dump-highlight-active,
672 .sf-dump-key.sf-dump-highlight-active {
673 background: rgba(253, 175, 0, 0.4);
674 border: 1px solid #ffa500;
677 pre.sf-dump .sf-dump-search-hidden {
680 pre.sf-dump .sf-dump-search-wrapper {
687 pre.sf-dump .sf-dump-search-wrapper > * {
689 box-sizing: border-box;
695 border: 1px solid #BBB;
697 pre.sf-dump .sf-dump-search-wrapper > input.sf-dump-search-input {
703 border-top-left-radius: 3px;
704 border-bottom-left-radius: 3px;
707 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next,
708 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous {
715 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next {
716 border-top-right-radius: 3px;
717 border-bottom-right-radius: 3px;
719 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next > svg,
720 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous > svg {
721 pointer-events: none;
725 pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-count {
726 display: inline-block;
736 foreach ($this->styles as $class => $style) {
737 $line .= 'pre.sf-dump'.('default' === $class ? ', pre.sf-dump' : '').' .sf-dump-'.$class.'{'.$style.'}';
740 return $this->dumpHeader = preg_replace('/\s+/', ' ', $line).'</style>'.$this->dumpHeader;
746 public function enterHash(Cursor $cursor, $type, $class, $hasChild)
748 parent::enterHash($cursor, $type, $class, false);
750 if ($cursor->skipChildren) {
751 $cursor->skipChildren = false;
752 $eol = ' class=sf-dump-compact>';
753 } elseif ($this->expandNextHash) {
754 $this->expandNextHash = false;
755 $eol = ' class=sf-dump-expanded>';
761 $this->line .= '<samp';
762 if ($cursor->refIndex) {
763 $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
764 $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
766 $this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r);
769 $this->dumpLine($cursor->depth);
776 public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut)
778 $this->dumpEllipsis($cursor, $hasChild, $cut);
780 $this->line .= '</samp>';
782 parent::leaveHash($cursor, $type, $class, $hasChild, 0);
788 protected function style($style, $value, $attr = array())
796 if ('ref' === $style) {
797 if (empty($attr['count'])) {
798 return sprintf('<a class=sf-dump-ref>%s</a>', $v);
800 $r = ('#' !== $v[0] ? 1 - ('@' !== $v[0]) : 2).substr($value, 1);
802 return sprintf('<a class=sf-dump-ref href=#%s-ref%s title="%d occurrences">%s</a>', $this->dumpId, $r, 1 + $attr['count'], $v);
805 if ('const' === $style && isset($attr['value'])) {
806 $style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
807 } elseif ('public' === $style) {
808 $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
809 } elseif ('str' === $style && 1 < $attr['length']) {
810 $style .= sprintf(' title="%d%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
811 } elseif ('note' === $style && false !== $c = strrpos($v, '\\')) {
812 return sprintf('<abbr title="%s" class=sf-dump-%s>%s</abbr>', $v, $style, substr($v, $c + 1));
813 } elseif ('protected' === $style) {
814 $style .= ' title="Protected property"';
815 } elseif ('meta' === $style && isset($attr['title'])) {
816 $style .= sprintf(' title="%s"', esc($this->utf8Encode($attr['title'])));
817 } elseif ('private' === $style) {
818 $style .= sprintf(' title="Private property defined in class: `%s`"', esc($this->utf8Encode($attr['class'])));
820 $map = static::$controlCharsMap;
822 if (isset($attr['ellipsis'])) {
823 $class = 'sf-dump-ellipsis';
824 if (isset($attr['ellipsis-type'])) {
825 $class = sprintf('"%s sf-dump-ellipsis-%s"', $class, $attr['ellipsis-type']);
827 $label = esc(substr($value, -$attr['ellipsis']));
828 $style = str_replace(' title="', " title=\"$v\n", $style);
829 $v = sprintf('<span class=%s>%s</span>', $class, substr($v, 0, -strlen($label)));
831 if (!empty($attr['ellipsis-tail'])) {
832 $tail = strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail'])));
833 $v .= sprintf('<span class=sf-dump-ellipsis>%s</span>%s', substr($label, 0, $tail), substr($label, $tail));
839 $v = "<span class=sf-dump-{$style}>".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) {
840 $s = '<span class=sf-dump-default>';
843 $s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', ord($c[$i]));
844 } while (isset($c[++$i]));
849 if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) {
850 $attr['href'] = $href;
852 if (isset($attr['href'])) {
853 $target = isset($attr['file']) ? '' : ' target="_blank"';
854 $v = sprintf('<a href="%s"%s rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $target, $v);
856 if (isset($attr['lang'])) {
857 $v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v);
866 protected function dumpLine($depth, $endOfValue = false)
868 if (-1 === $this->lastDepth) {
869 $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line;
871 if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) {
872 $this->line = $this->getDumpHeader().$this->line;
876 $args = array('"'.$this->dumpId.'"');
877 if ($this->extraDisplayOptions) {
878 $args[] = json_encode($this->extraDisplayOptions, JSON_FORCE_OBJECT);
881 $this->line .= sprintf(str_replace('"%s"', '%s', $this->dumpSuffix), implode(', ', $args));
883 $this->lastDepth = $depth;
885 $this->line = mb_convert_encoding($this->line, 'HTML-ENTITIES', 'UTF-8');
888 AbstractDumper::dumpLine(0);
890 AbstractDumper::dumpLine($depth);
893 private function getSourceLink($file, $line)
895 $options = $this->extraDisplayOptions + $this->displayOptions;
897 if ($fmt = $options['fileLinkFormat']) {
898 return is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line);
907 return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');