allow to set all post_install parameters via environment EGW_*

Parameter: --ldap_base --> EGW_LDAP_BASE (/ and - are converted to _)
This commit is contained in:
Ralf Becker 2019-07-23 19:46:25 +02:00
parent 07d698cbc4
commit 53c3dc2e35

View File

@ -185,6 +185,15 @@ function set_distro_defaults($distro=null)
}
set_distro_defaults();
// read EGW_* environment variables overwriting default config above allowing to set all parameters via environment
foreach($config as $name => $value)
{
if (isset($_SERVER[$env='EGW_'.strtoupper(strtr($name, ['-'=>'_','/'=>'_']))]) && $_SERVER[$env] !== $value)
{
$config[$name] = $_SERVER[$env];
}
}
// read config from command line
$argv = str_replace(array("''", '""'), '', $_SERVER['argv']);
$prog = array_shift($argv);