Skip to content

Commit

Permalink
Merge pull request #271 from Korko/patch-1
Browse files Browse the repository at this point in the history
Allow override of Dumper via SERVER variable
  • Loading branch information
freekmurze committed Jul 13, 2020
2 parents bc107b2 + 73c2521 commit f2cfb83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DumpRecorder/DumpRecorder.php
Expand Up @@ -87,7 +87,11 @@ protected function getDefaultHandler()
return function ($value) {
$data = (new VarCloner)->cloneVar($value);

$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new BaseHtmlDumper;
if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
$dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new BaseHtmlDumper : new CliDumper;
} else {
$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new BaseHtmlDumper;
}
$dumper->dump($data);
};
}
Expand Down

0 comments on commit f2cfb83

Please sign in to comment.