Skip to content

Commit

Permalink
Merge pull request #69 from Moros1138/filter-compiler-output
Browse files Browse the repository at this point in the history
Filter compiler output
  • Loading branch information
Moros1138 authored May 18, 2024
2 parents ab1a71b + 4b3ffbf commit f824d70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions app/Http/Controllers/CodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,6 @@ function compileCode($code)
];
}

function filterOutput($text)
{
$text = str_replace("/opt/emsdk/upstream/emscripten/cache/sysroot", "/***", $text);
return $text;
}

}


16 changes: 11 additions & 5 deletions pgetinker/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,20 @@ 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()
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()
Expand Down Expand Up @@ -514,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");
}

Expand Down

0 comments on commit f824d70

Please sign in to comment.