本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::configPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::configPath方法的具体用法?PHP Application::configPath怎么用?PHP Application::configPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::configPath方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfigurationFiles
/**
* 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;
}
示例2: getConfigurationFiles
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;
}
示例3: getConfigurationFiles
/**
* @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;
}
示例4: getConfigurationFiles
/**
* 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;
}
示例5: loadConfigurationFiles
/**
* 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));
}
}
示例6: bootstrap
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));
}
}
示例7: getConfigurationFiles
/**
* 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;
}
示例8: getConfigurationFiles
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;
}
示例9: bootstrap
/**
* 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');
}