/** * Stack custom config on top of default config to get a complete config array. * If isset static $config, use it to prevent loading a file over and over again. * @param use params to move deeper into array * @return array with merged config */ private static function getConfig() { if (!isset(self::$config)) { $default = Format::jsonToArray(File::get('../config/default.config.json')); $custom = Format::jsonToArray(File::get('../config/custom.config.json')); if ($default && $custom) { self::$config = self::merge($default, $custom); } else { if ($default) { self::$config = $default; } } } if (isset(self::$config)) { return self::$config; } return false; }