From f2f8c97b7c672da589329bfdeb207e7164170773 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Mon, 4 Feb 2019 02:06:15 +0100 Subject: [PATCH] Bugfixing Addon-config --- src/Core/Config/ConfigCacheLoader.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Core/Config/ConfigCacheLoader.php b/src/Core/Config/ConfigCacheLoader.php index a23e1e848a..6a1d438401 100644 --- a/src/Core/Config/ConfigCacheLoader.php +++ b/src/Core/Config/ConfigCacheLoader.php @@ -16,7 +16,12 @@ class ConfigCacheLoader * The Sub directory of the config-files * @var string */ - const SUBDIRECTORY = '/config/'; + const SUBDIRECTORY = '/config/'; + /** + * The addon sub-directory + * @var string + */ + const ADDONDIRECTORY = '/addon/'; private $baseDir; private $configDir; @@ -129,12 +134,17 @@ class ConfigCacheLoader * ]; * * @param string $filename + * @param bool $addon True, if a config for an addon should be loaded * @return array The configuration * @throws \Exception */ - public function loadConfigFile($filename) + public function loadConfigFile($filename, $addon = false) { - $filepath = $this->configDir . $filename . ".config.php"; + if ($addon) { + $filepath = $this->baseDir . self::ADDONDIRECTORY . self::SUBDIRECTORY . $filename . ".config.php"; + } else { + $filepath = $this->configDir . $filename . ".config.php"; + } if (!file_exists($filepath)) { throw new \Exception('Error loading non-existent config file ' . $filepath); -- 2.39.5