19 declare(strict_types=1);
47 return str_replace(
"\0",
'', $ret);
60 return Formatter::formatExceptionPlain($this->getInspector());
69 foreach ($this->
tables() as $title => $content) {
70 $ret .=
"\n\n-- $title --\n\n";
71 if (count($content) > 0) {
72 foreach ($content as
$key => $value) {
73 $key = str_pad((
string)
$key, self::KEY_SPACE);
78 $indentation = str_pad(
'', self::KEY_SPACE);
82 static function ($line) use (&$first, $indentation):
string {
87 return $indentation . $line;
89 explode(
"\n", print_r($value,
true))
93 $ret .=
"$key: $value\n";
117 'POST Data' =>
$post,
120 'Session' => $_SESSION ?? [],
121 'Server/Request Data' =>
$server,
122 'Environment Variables' => $_ENV,
132 foreach ($this->exclusion_list as $parameter) {
133 if (isset($super_global[$parameter])) {
134 $super_global[$parameter] =
'REMOVED FOR SECURITY';
137 if (isset($super_global[
'post_vars'][$parameter])) {
138 $super_global[
'post_vars'][$parameter] =
'REMOVED FOR SECURITY';
142 return $super_global;
151 $cookie_content = $server[
'HTTP_COOKIE'];
152 $cookie_content = explode(
';', $cookie_content);
154 foreach ($cookie_content as
$key => $content) {
155 $content_array = explode(
'=', $content);
156 if (trim($content_array[0]) === session_name()) {
157 $content_array[1] = substr($content_array[1], 0, 5) .
' (SHORTENED FOR SECURITY)';
158 $cookie_content[
$key] = implode(
'=', $content_array);
162 $server[
'HTTP_COOKIE'] = implode(
';', $cookie_content);
withExclusionList(array $exclusion_list)
tablesContent()
Get the header for the page.
shortenPHPSessionId(array $server)
hideSensitiveData(array $super_global)
tables()
Get the tables that should be rendered.
A Whoops error handler that prints the same content as the PrettyPageHandler but as plain text...
getExceptionOutput()
Get a short info about the exception.
stripNullBytes(string $ret)