mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Allow custom config file path (#145)
* allow custom config file path * Update configuration.md
This commit is contained in:
committed by
GitHub
parent
bded9f754e
commit
f6d04777e1
@@ -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)) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user