43 public function renderHumanReadable() : void{
44 $this->addLine($this->data->general->name .
" Crash Dump " . date(
"D M j H:i:s T Y", (int) $this->data->time));
47 $version =
new VersionString($this->data->general->base_version, $this->data->general->is_dev, $this->data->general->build);
48 $this->addLine($this->data->general->name .
" version: " . $version->getFullVersion(
true) .
" [Protocol " . $this->data->general->protocol .
"]");
49 $this->addLine(
"Git commit: " . $this->data->general->git);
50 $this->addLine(
"PHP version: " . $this->data->general->php);
51 $this->addLine(
"OS: " . $this->data->general->php_os .
", " . $this->data->general->os);
53 if($this->data->plugin_involvement !== CrashDump::PLUGIN_INVOLVEMENT_NONE){
55 $this->addLine(match($this->data->plugin_involvement){
56 CrashDump::PLUGIN_INVOLVEMENT_DIRECT =>
"THIS CRASH WAS CAUSED BY A PLUGIN",
57 CrashDump::PLUGIN_INVOLVEMENT_INDIRECT =>
"A PLUGIN WAS INVOLVED IN THIS CRASH",
58 default =>
"Unknown plugin involvement!"
61 if($this->data->plugin !==
""){
62 $this->addLine(
"BAD PLUGIN: " . $this->data->plugin);
67 $this->addLine(
"Thread: " . $this->data->thread);
68 $this->addLine(
"Error: " . $this->data->error[
"message"]);
69 $this->addLine(
"File: " . $this->data->error[
"file"]);
70 $this->addLine(
"Line: " . $this->data->error[
"line"]);
71 $this->addLine(
"Type: " . $this->data->error[
"type"]);
72 $this->addLine(
"Backtrace:");
73 foreach($this->data->trace as $line){
74 $this->addLine($line);
78 $this->addLine(
"Code:");
80 foreach($this->data->code as $lineNumber => $line){
81 $this->addLine(
"[$lineNumber] $line");
84 if(count($this->data->plugins) > 0){
86 $this->addLine(
"Loaded plugins:");
87 foreach($this->data->plugins as $p){
88 $this->addLine($p->name .
" " . $p->version .
" by " . implode(
", ", $p->authors) .
" for API(s) " . implode(
", ", $p->api));
93 $this->addLine(
"uname -a: " . $this->data->general->uname);
94 $this->addLine(
"Zend version: " . $this->data->general->zend);
95 $this->addLine(
"Composer libraries: ");
96 foreach(Utils::stringifyKeys($this->data->general->composer_libraries) as $library => $libraryVersion){
97 $this->addLine(
"- $library $libraryVersion");
101 public function addLine(
string $line =
"") : void{
102 fwrite($this->fp, $line . PHP_EOL);