Make config.php settings also available as environment variables (closes #118)

This commit is contained in:
Bernd Bestel
2018-12-23 16:45:16 +01:00
parent 04dacacd73
commit bdcd176f81
2 changed files with 18 additions and 0 deletions

View File

@@ -138,6 +138,10 @@ function Setting(string $name, $value)
{
define('GROCY_' . $name, file_get_contents($settingOverrideFile));
}
elseif (getenv('GROCY_' . $name) !== false) // An environment variable with the same name and prefix GROCY_ overwrites the given setting
{
define('GROCY_' . $name, getenv('GROCY_' . $name));
}
else
{
define('GROCY_' . $name, $value);