diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 10a57f5..770c3d2 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -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)) { diff --git a/docs/client/configuration.md b/docs/client/configuration.md index 96051bd..ce21d6f 100644 --- a/docs/client/configuration.md +++ b/docs/client/configuration.md @@ -17,6 +17,12 @@ The configuration file will be written to your home directory inside a `.expose` `~/.expose/config.php` +You can also provide a custom location of the config file by providing the full path as a server variable. + +```bash +EXPOSE_CONFIG_FILE="~/my-custom-config.php" expose share +``` + And the default content of the configuration file is this: ```php