read a config.php file from root #156
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -65,6 +65,7 @@ phpvms_next.iml
|
||||
public/info.php
|
||||
|
||||
local.conf.php
|
||||
config.php
|
||||
|
||||
# Error Logs
|
||||
error_log
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user