diff --git a/src/Framework/Config/ConfigService.php b/src/Framework/Config/ConfigService.php index cdc1638..43147a4 100644 --- a/src/Framework/Config/ConfigService.php +++ b/src/Framework/Config/ConfigService.php @@ -31,7 +31,6 @@ public function register() $configCacheFile = self::$configCacheDir . "/config.php"; $config = $this->getConfig($configCacheFile, __BASEDIR__ . '/config/config.yml'); - $this->registerAppConfig($config); date_default_timezone_set($this->app['timezone']); $this->registerBusinessConfig($config); @@ -43,7 +42,7 @@ public function parseResource($resource, $isCustom) if (true == $isCustom) { $configResourceDir = self::$configCacheDir . "/" . substr($resource, 0, -11); $configCacheFile = $configResourceDir . "/config.php"; - $config = $this->getConfig($configCacheFile, __BASEDIR__ . "/src/{$resource}"); + $config = $this->getConfig($configCacheFile, __BASEDIR__ . "/src/{$resource}", $isCustom, $configResourceDir); } if (false == $isCustom) { @@ -181,7 +180,7 @@ private function registerBusinessConfig($configs) } } - private function getConfig($configCacheFile, $parseFile) + private function getConfig($configCacheFile, $parseFile, $isCustom = false, $configResourceDir = "") { if (file_exists($configCacheFile)) { return require $configCacheFile; @@ -195,8 +194,13 @@ private function getConfig($configCacheFile, $parseFile) $configs = YamlService::parse(file_get_contents($parseFile)); } + $configCacheDir = ""; + if ($isCustom) { + $configCacheDir = $configResourceDir; + } + if ($this->enabledCache) { - $this->createCache($configs, $configCacheFile); + $this->createCache($configs, $configCacheFile, $configCacheDir); } return $configs;