Allow custom config file path (#145)

* allow custom config file path

* Update configuration.md
This commit is contained in:
Siebe Vanden Eynden authored and GitHub committed 2020-12-04 22:45:29 +01:00
1 parent bded9f754e
commit f6d04777e1
2 files changed
+14

No files matched your search

+8
View File
@@ -37,6 +37,14 @@ class AppServiceProvider extends ServiceProvider
{
$builtInConfig = config('expose');
$keyServerVariable = 'EXPOSE_CONFIG_FILE';
if (array_key_exists($keyServerVariable, $_SERVER) && is_string($_SERVER[$keyServerVariable]) && file_exists($_SERVER[$keyServerVariable])) {
$localConfig = require $_SERVER[$keyServerVariable];
config()->set('expose', array_merge($builtInConfig, $localConfig));
return;
}
$localConfigFile = getcwd().DIRECTORY_SEPARATOR.'.expose.php';
if (file_exists($localConfigFile)) {