read a config.php file from root #156

This commit is contained in:
Nabeel Shahzad
2018-01-28 21:05:02 -06:00
parent 83a9a8dfbd
commit b1759d9276
2 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View File

@@ -65,6 +65,7 @@ phpvms_next.iml
public/info.php
local.conf.php
config.php
# Error Logs
error_log

View File

@@ -31,13 +31,15 @@ class AppServiceProvider extends ServiceProvider
}
# if there's a local.conf.php in the root, then merge that in
if(file_exists(base_path('local.conf.php'))) {
$local_conf = include base_path('local.conf.php');
$config = $this->app['config']->get('phpvms', []);
$this->app['config']->set(
'phpvms',
array_merge($config, $local_conf)
);
if(file_exists(base_path('config.php'))) {
$local_conf = include base_path('config.php');
foreach($local_conf as $namespace => $override_config) {
$config = $this->app['config']->get($namespace, []);
$this->app['config']->set(
$namespace,
array_merge($config, $override_config)
);
}
}
}