/** * loadConfiguration method * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ protected function loadConfiguration() { /** @var \Illuminate\Filesystem\Filesystem $fs */ $fs = new Filesystem(); $items = new Repository(); foreach ($fs->files($this->getConfigDir()) as $file) { $items->set(Path::getFilenameWithoutExtension($file), $fs->getRequire($file)); } $this->items = $items; }
/** * bootstrap method * * @param \Raphaelb\Foundation\Application $app * * @return mixed */ public function bootstrap(Application $app) { $items = []; /** @var \Illuminate\Filesystem\Filesystem $fs */ $fs = new Filesystem(); $app->instance('config', $config = new Repository($items)); foreach ($fs->files($app->getConfigPath()) as $file) { $config->set(Path::getFilenameWithoutExtension($file), $fs->getRequire($file)); } // Foreach loop for .phar file. // foreach (scandir($app->getConfigPath()) as $file ) // { // $config->set( // Path::getFilenameWithoutExtension($file), // $fs->getRequire($app->getConfigPath() . '/' .$file) // ); // } return $config; }