Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Extension/DumpExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DumpExtension extends \Twig_Extension
public function __construct(ClonerInterface $cloner, HtmlDumper $dumper = null)
{
$this->cloner = $cloner;
$this->dumper = $dumper ?: new HtmlDumper();
$this->dumper = $dumper ?: new HtmlDumper(null, null, HtmlDumper::DUMP_LIGHT_ARRAY);
}

public function getFunctions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getDumpArgs()
array(
array('foo' => 'bar'),
array(),
"<pre class=sf-dump id=sf-dump data-indent-pad=\" \"><span class=sf-dump-note>array:1</span> [<samp>\n"
"<pre class=sf-dump id=sf-dump data-indent-pad=\" \">[<samp>\n"
." \"<span class=sf-dump-key>foo</span>\" => \"<span class=sf-dump-str title=\"3 characters\">bar</span>\"\n"
."</samp>]\n"
."</pre><script>Sfdump(\"sf-dump\")</script>\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ public function collect(Request $request, Response $response, \Exception $except
|| false === strripos($response->getContent(), '</body>')
) {
if ($response->headers->has('Content-Type') && false !== strpos($response->headers->get('Content-Type'), 'html')) {
$this->dumper = new HtmlDumper('php://output', $this->charset);
$this->dumper = new HtmlDumper('php://output', $this->charset, HtmlDumper::DUMP_LIGHT_ARRAY);
} else {
$this->dumper = new CliDumper('php://output', $this->charset);
$this->dumper = new CliDumper('php://output', $this->charset, HtmlDumper::DUMP_LIGHT_ARRAY);
}

foreach ($this->data as $dump) {
Expand Down Expand Up @@ -193,7 +193,7 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
$data = fopen('php://memory', 'r+b');

if ('html' === $format) {
$dumper = new HtmlDumper($data, $this->charset);
$dumper = new HtmlDumper($data, $this->charset, HtmlDumper::DUMP_LIGHT_ARRAY);
} else {
throw new \InvalidArgumentException(sprintf('Invalid dump format: %s', $format));
}
Expand Down Expand Up @@ -229,9 +229,9 @@ public function __destruct()
}

if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) {
$this->dumper = new HtmlDumper('php://output', $this->charset);
$this->dumper = new HtmlDumper('php://output', $this->charset, HtmlDumper::DUMP_LIGHT_ARRAY);
} else {
$this->dumper = new CliDumper('php://output', $this->charset);
$this->dumper = new CliDumper('php://output', $this->charset, HtmlDumper::DUMP_LIGHT_ARRAY);
}

foreach ($this->data as $i => $dump) {
Expand Down Expand Up @@ -281,7 +281,7 @@ private function htmlEncode($s)
{
$html = '';

$dumper = new HtmlDumper(function ($line) use (&$html) {$html .= $line;}, $this->charset);
$dumper = new HtmlDumper(function ($line) use (&$html) {$html .= $line;}, $this->charset, HtmlDumper::DUMP_LIGHT_ARRAY);
$dumper->setDumpHeader('');
$dumper->setDumpBoundaries('', '');

Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Component/VarDumper/VarDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static function dump($var)
{
if (null === self::$handler) {
$cloner = new VarCloner();
$dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
$dumper = 'cli' === PHP_SAPI ? CliDumper::class : HtmlDumper::class;
$dumper = new $dumper(null, null, CliDumper::DUMP_LIGHT_ARRAY);
self::$handler = function ($var) use ($cloner, $dumper) {
$dumper->dump($cloner->cloneVar($var));
};
Expand Down