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
View File
@@ -65,6 +65,7 @@ phpvms_next.iml
public/info.php public/info.php
local.conf.php local.conf.php
config.php
# Error Logs # Error Logs
error_log error_log
+9 -7
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 there's a local.conf.php in the root, then merge that in
if(file_exists(base_path('local.conf.php'))) { if(file_exists(base_path('config.php'))) {
$local_conf = include base_path('local.conf.php'); $local_conf = include base_path('config.php');
$config = $this->app['config']->get('phpvms', []); foreach($local_conf as $namespace => $override_config) {
$this->app['config']->set( $config = $this->app['config']->get($namespace, []);
'phpvms', $this->app['config']->set(
array_merge($config, $local_conf) $namespace,
); array_merge($config, $override_config)
);
}
} }
} }