- if (file_exists($this->getBasePath() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'addon.ini.php')) {
- $this->loadConfigFile($this->getBasePath() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'addon.ini.php', true);
+ if (file_exists($this->getBasePath() . '/config/addon.config.php')) {
+ $this->loadConfigFile($this->getBasePath() . '/config/addon.config.php', true);
+ } elseif (file_exists($this->getBasePath() . '/config/addon.ini.php')) {
+ $this->loadINIConfigFile($this->getBasePath() . '/config/addon.ini.php', true);
+ }
+ }
+
+ /**
+ * Tries to load the specified configuration array into the App->config array.
+ * Doesn't overwrite previously set values by default to prevent default config files to supersede DB Config.
+ *
+ * @param array $config
+ * @param bool $overwrite Force value overwrite if the config key already exists
+ */
+ private function loadConfigArray(array $config, $overwrite = false)
+ {
+ foreach ($config as $category => $values) {
+ foreach ($values as $key => $value) {
+ if ($overwrite) {
+ $this->setConfigValue($category, $key, $value);
+ } else {
+ $this->setDefaultConfigValue($category, $key, $value);
+ }
+ }