Merge pull request #13473 from nervo/patch-1
NEW [Allow constants values to be overridden by environment variables]
This commit is contained in:
commit
87d46c4e86
@ -171,6 +171,13 @@ class Conf
|
|||||||
$value = $objp->value;
|
$value = $objp->value;
|
||||||
if ($key)
|
if ($key)
|
||||||
{
|
{
|
||||||
|
// Allow constants values to be overridden by environment variables
|
||||||
|
if (isset($_SERVER['DOLIBARR_' . $key])) {
|
||||||
|
$value=$_SERVER['DOLIBARR_' . $key];
|
||||||
|
} elseif (isset($_ENV['DOLIBARR_' . $key])) {
|
||||||
|
$value=$_ENV['DOLIBARR_' . $key];
|
||||||
|
}
|
||||||
|
|
||||||
//if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
|
//if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install)
|
||||||
$this->global->$key = $value;
|
$this->global->$key = $value;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user