read a config.php file from root #156
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user