/** * Get all of the configuration files for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @return array */ protected function getConfigurationFiles(Application $app) { $files = []; foreach (Finder::create()->files()->name('*.php')->in($app->configPath()) as $file) { $files[basename($file->getRealPath(), '.php')] = $file->getRealPath(); } return $files; }
protected function getConfigurationFiles(Application $app) { $configPath = str_finish($app->configPath(), '/'); $files = $this->getConfigurationFilesInPath($configPath); foreach (explode('.', $app->environment()) as $env) { $configPath .= $env . '/'; $files = array_merge_recursive($files, $this->getConfigurationFilesInPath($configPath)); } return $files; }
/** * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app * * @return array */ protected function getConfigurationFiles(Application $app) { $files = []; $configPath = realpath($app->configPath()); foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) { $nesting = $this->getConfigurationNesting($file, $configPath); $files[$nesting . basename($file->getRealPath(), '.php')] = $file->getRealPath(); } return $files; }
/** * Get all of the configuration files for the application. * * @param Application $app * * @return array */ protected function getConfigurationFiles(Application $app) { $files = []; foreach ($this->getAllowedFileExtensions() as $extension) { foreach (Finder::create()->files()->name('*.' . $extension)->in($app->configPath()) as $file) { $nesting = $this->getConfigurationNesting($file, config_path()); $files[$nesting . basename($file->getRealPath(), '.' . $extension)] = $file->getRealPath(); } } return $files; }
/** * Load the configuration items from all of the files. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Contracts\Config\Repository $repository * @return void */ protected function loadConfigurationFiles(Application $app, RepositoryContract $repository) { $baseFiles = $this->getConfigurationFiles($app->baseConfigPath()); $projFiles = !$app->isBaseProject() ? $this->getConfigurationFiles($app->configPath()) : []; $keys = array_unique(array_merge(array_keys($baseFiles), array_keys($projFiles))); foreach ($keys as $key) { $baseCfg = array_key_exists($key, $baseFiles) ? require $baseFiles[$key] : []; $projCfg = array_key_exists($key, $projFiles) ? require $projFiles[$key] : []; $repository->set($key, array_merge($baseCfg, $projCfg)); } }
public function bootstrap(Application $app) { $this->app = $app; $this->fs = new Filesystem(); $paths = [$app->exportPath(), $app->homePath(), $app->storagePath(), $app->databasePath(), $app->publicPath(), $app->configPath()]; foreach ($paths as $path) { $this->ensureDirectory($path); } $storagePaths = ['app', 'framework', 'framework/cache', 'framework/views', 'framework/sessions', 'logs', $app->getSlug()]; foreach ($storagePaths as $path) { $this->ensureDirectory(path_join($app->storagePath(), $path)); } }
/** * Get all of the configuration files for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @return array */ protected function getConfigurationFiles(Application $app) { $files = []; foreach (Finder::create()->files()->name('*.php')->in($app->configPath()) as $file) { $nesting = $this->getConfigurationNesting($file); $files[$nesting . basename($file->getPathname(), '.php')] = $file->getPathname(); } // Verificar se tem um arquivo de configuracao na pasta do pchar $config_root = root_path('config.php'); if (file_exists($config_root)) { $files['config'] = $config_root; } return $files; }
protected function getConfigurationFiles(Application $app) { $files = []; $configPath = realpath($app->configPath()); $ondemand = explode(",", env('CONF_ONDEMAND', "")); foreach (Finder::create()->files()->name('*.*')->in($configPath) as $file) { $nesting = $this->getConfigurationNesting($file, $configPath); $parts = explode('.', $file); $ext = array_pop($parts); $key = $nesting . basename($file->getRealPath(), '.' . $ext); if (in_array($key, $ondemand)) { continue; } $files[$key] = $file->getRealPath(); } return $files; }
/** * Bootstrap the given application. * * @param \Illuminate\Contracts\Foundation\Application $app * @return void */ public function bootstrap(Application $app) { $items = []; // First we will see if we have a cache configuration file. If we do, we'll load // the configuration items from that file so that it is very quick. Otherwise // we will need to spin through every configuration file and load them all. /*if (file_exists($cached = $app->getCachedConfigPath())) { $items = require $cached; $loadedFromCache = true; }*/ $app->instance('config', $config = new IlluminatoRepository($items)); // Next we will spin through all of the configuration files in the configuration // directory and load each one into the repository. This will make all of the // options available to the developer for use in various parts of this app. if (!isset($loadedFromCache)) { $this->loadConfigurationFiles($app->configPath(), $config); } date_default_timezone_set($config['app.timezone']); mb_internal_encoding('UTF-8'); }