From 586f03398ce14eda0d51d4cd4a41e3ba09587222 Mon Sep 17 00:00:00 2001 From: Moros Smith Date: Fri, 17 May 2024 21:41:32 -0400 Subject: [PATCH 1/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a20998..d21859c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ It is a summary of changes that would be pertinent to the end user of the PGEtin - Added support to deploy on subpaths - Added updated version of PGE, Extensions, and Utlities - Fixed patreon supporters not updated after PGEtinker upgrades +- Added filters for compiler output ## 2024-05-14 From 38255677c64ad73406342734ab72f1d7c5e4df0f Mon Sep 17 00:00:00 2001 From: Moros Smith Date: Fri, 17 May 2024 21:41:49 -0400 Subject: [PATCH 2/5] remove unused function in CodeController --- app/Http/Controllers/CodeController.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/Http/Controllers/CodeController.php b/app/Http/Controllers/CodeController.php index 01d553c..1117357 100644 --- a/app/Http/Controllers/CodeController.php +++ b/app/Http/Controllers/CodeController.php @@ -192,12 +192,6 @@ function compileCode($code) ]; } - function filterOutput($text) - { - $text = str_replace("/opt/emsdk/upstream/emscripten/cache/sysroot", "/***", $text); - return $text; - } - } From 81d42f75489cf636762ab67fa29695e53e99dc52 Mon Sep 17 00:00:00 2001 From: Moros Smith Date: Fri, 17 May 2024 21:42:15 -0400 Subject: [PATCH 3/5] add filtering to getOutput --- pgetinker/Compiler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pgetinker/Compiler.php b/pgetinker/Compiler.php index 53a72e0..8b71641 100644 --- a/pgetinker/Compiler.php +++ b/pgetinker/Compiler.php @@ -93,9 +93,12 @@ public function setWorkingDirectory(string $workingDirectory) return $this; } - public function getOutput() + public function getOutput($raw = false) { - return implode("\n", $this->output); + if($raw) + return implode("\n", $this->output); + + return str_replace("/opt/emsdk/upstream/emscripten/cache/sysroot", "/***", implode("\n", $this->output)); } public function getErrorOutput() From 50f1d8447dd1d581dfe3eeac7d81551fb4621f33 Mon Sep 17 00:00:00 2001 From: Moros Smith Date: Fri, 17 May 2024 21:42:26 -0400 Subject: [PATCH 4/5] add filtering to getErrorOutput --- pgetinker/Compiler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pgetinker/Compiler.php b/pgetinker/Compiler.php index 8b71641..7fcbf5f 100644 --- a/pgetinker/Compiler.php +++ b/pgetinker/Compiler.php @@ -101,9 +101,12 @@ public function getOutput($raw = false) return str_replace("/opt/emsdk/upstream/emscripten/cache/sysroot", "/***", implode("\n", $this->output)); } - public function getErrorOutput() + public function getErrorOutput($raw = false) { - return implode("\n", $this->errors); + if($raw) + return implode("\n", $this->errors); + + return str_replace("/opt/emsdk/upstream/emscripten/cache/sysroot", "/***", implode("\n", $this->errors)); } public function getHtml() From 4b3ffbfbbae434d624915a69bbeb5d4bd833ffce Mon Sep 17 00:00:00 2001 From: Moros Smith Date: Fri, 17 May 2024 21:42:45 -0400 Subject: [PATCH 5/5] get raw output for compiler log file --- pgetinker/Compiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgetinker/Compiler.php b/pgetinker/Compiler.php index 7fcbf5f..f83d147 100644 --- a/pgetinker/Compiler.php +++ b/pgetinker/Compiler.php @@ -520,7 +520,7 @@ private function link() private function cleanUp() { - $this->logger->info("OUTPUT:\n\n" . $this->getOutput() . "\n\nERROR:\n\n" . $this->getErrorOutput()); + $this->logger->info("OUTPUT:\n\n" . $this->getOutput(true) . "\n\nERROR:\n\n" . $this->getErrorOutput(true)); Log::info("Compile: finished disgracefully"); }