19 declare(strict_types=1);
47 return str_replace(
"\0",
'', $ret);
58 '%s: %s in file %s on line %d',
59 get_class($exception),
60 $exception->getMessage(),
61 $exception->getFile(),
71 $message = Formatter::formatExceptionPlain($this->getInspector());
74 $exception = $this->getInspector()->getException();
75 $previous = $exception->getPrevious();
78 $previous = $previous->getPrevious();
91 foreach ($this->
tables() as $title => $content) {
92 $ret .=
"\n\n-- $title --\n\n";
93 if (count($content) > 0) {
94 foreach ($content as $key => $value) {
95 $key = str_pad((
string) $key, self::KEY_SPACE);
100 $indentation = str_pad(
'', self::KEY_SPACE);
104 static function ($line) use (&$first, $indentation):
string {
109 return $indentation . $line;
111 explode(
"\n", print_r($value,
true))
115 $ret .=
"$key: $value\n";
139 'POST Data' =>
$post,
142 'Session' => $_SESSION ?? [],
143 'Server/Request Data' =>
$server,
144 'Environment Variables' => $_ENV,
154 foreach ($this->exclusion_list as $parameter) {
155 if (isset($super_global[$parameter])) {
156 $super_global[$parameter] =
'REMOVED FOR SECURITY';
159 if (isset($super_global[
'post_vars'][$parameter])) {
160 $super_global[
'post_vars'][$parameter] =
'REMOVED FOR SECURITY';
164 return $super_global;
173 $cookie_content = $server[
'HTTP_COOKIE'];
174 $cookie_content = explode(
';', $cookie_content);
176 foreach ($cookie_content as $key => $content) {
177 $content_array = explode(
'=', $content);
178 if (trim($content_array[0]) === session_name()) {
179 $content_array[1] = substr($content_array[1], 0, 5) .
' (SHORTENED FOR SECURITY)';
180 $cookie_content[$key] = implode(
'=', $content_array);
184 $server[
'HTTP_COOKIE'] = implode(
';', $cookie_content);
getSimpleExceptionOutput(Throwable $exception)
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...
getPlainTextExceptionOutput(bool $with_previous=true)
Get a short info about the exception.
stripNullBytes(string $ret)