Compare commits

...

2 Commits

Author SHA1 Message Date
Bernd Bestel
b9f0470d76 Prepared next release 2018-12-30 09:21:11 +01:00
Bernd Bestel
bdcd176f81 Make config.php settings also available as environment variables (closes #118) 2018-12-23 16:45:16 +01:00
3 changed files with 20 additions and 2 deletions

View File

@@ -1,5 +1,19 @@
<?php
# Settings can also be overwritten in two ways
#
# First priority
# A .txt file with the same name as the setting in /data/settingoverrides
# the content of the file is used as the setting value
#
# Second priority
# An environment variable with the same name as the setting and prefix "GROCY_"
# so for example "GROCY_BASE_URL"
#
# Third priority
# The settings defined here below
# Either "production", "dev" or "prerelease"
Setting('MODE', 'production');

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);

View File

@@ -1,4 +1,4 @@
{
"Version": "1.23.1",
"ReleaseDate": "2018-11-27"
"Version": "1.24.0",
"ReleaseDate": "2018-12-30"
}