diff --git a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php index 0eb3788a1418..6e8e44c6fcae 100644 --- a/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php +++ b/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php @@ -69,7 +69,8 @@ protected function getConfigurationFiles(Application $app) foreach (Finder::create()->files()->name('*.php')->in($app->configPath()) as $file) { - $files[basename($file->getRealPath(), '.php')] = $file->getRealPath(); + $key = str_replace('\\','/',substr($file->getRealPath(), strlen($app->configPath()) + 1, -4)); + $files[/*basename($file->getRealPath(), '.php')*/$key] = $file->getRealPath(); } return $files; diff --git a/src/Illuminate/Support/ServiceProvider.php b/src/Illuminate/Support/ServiceProvider.php index c4e454f64163..a74173e256dc 100755 --- a/src/Illuminate/Support/ServiceProvider.php +++ b/src/Illuminate/Support/ServiceProvider.php @@ -1,6 +1,7 @@ mergeConfigFromDir($path,$key); + else + $this->mergeConfigFromFile($path,$key); + } + + protected function mergeConfigFromDir($path, $key) + { + foreach (Finder::create()->files()->name('*.php')->in(realpath($path)) as $file) + { + $subKey = str_replace('\\','/',substr($file->getRealPath(), strlen(realpath($path)) + 1, -4)); + $this->mergeConfigFromFile($file->getRealPath(), $key.'/'.$subKey); + } + } + + protected function mergeConfigFromFile($path, $key) { $config = $this->app['config']->get($key, []);