From 258dabdf83028507a0b97e4149427deec018713a Mon Sep 17 00:00:00 2001 From: Sebastian Zoglowek Date: Wed, 23 Aug 2023 13:58:49 +0200 Subject: [PATCH 1/2] Allow passing custom skin files to compiler --- src/Compiler/FileCompiler.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Compiler/FileCompiler.php b/src/Compiler/FileCompiler.php index 4d87b9f..7dd5f3e 100644 --- a/src/Compiler/FileCompiler.php +++ b/src/Compiler/FileCompiler.php @@ -83,6 +83,11 @@ class FileCompiler */ protected string $rootDir; + /** + * Custom skin files + */ + public array $customSkinFiles = []; + /** * FileCompiler constructor. */ @@ -181,9 +186,9 @@ public function compileConfigFiles(): void public function compileSkinFiles(): void { $arrContent = []; - $skinFiles = StringUtil::deserialize($this->objTheme->skinSourceFiles); + $skinFiles = array_merge($this->customSkinFiles, StringUtil::deserialize($this->objTheme->skinSourceFiles, true)); - if (null !== $skinFiles) + if (!empty($skinFiles)) { // reverse loading order so following skin files will override configurations from previous ones $skinFiles = array_reverse($skinFiles); From 33e545374ddd94ed68f0c82fc9d2509d43148d41 Mon Sep 17 00:00:00 2001 From: Sebastian Zoglowek Date: Wed, 23 Aug 2023 14:01:24 +0200 Subject: [PATCH 2/2] Fixed an output bug - do not display wrong "compile file" path within theme compiler output --- src/Compiler/FileCompiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/FileCompiler.php b/src/Compiler/FileCompiler.php index 7dd5f3e..fd6d4bd 100644 --- a/src/Compiler/FileCompiler.php +++ b/src/Compiler/FileCompiler.php @@ -204,7 +204,7 @@ public function compileSkinFiles(): void continue; } - $this->msg('Compile file: ' . $file->path . '/' . $file->name); + $this->msg('Compile file: ' . $file->path); $filename = StringUtil::standardize(basename($file->name, $file->extension)); $content = $this->getFileContent($file->path);