N°2478 Fix unattended install

* remove require() calls (now we have an autoloader \o/)
* change cache policy in utils::GetConfig
* set config in utils class from ApplicationInstaller
This commit is contained in:
Pierre Goiffon
2019-09-11 11:36:05 +02:00
parent d71b3b1893
commit 7f156e961d
4 changed files with 140 additions and 111 deletions

View File

@@ -20,7 +20,32 @@ abstract class Parameters
}
return $default;
}
/**
* @return array to use with {@see Config::UpdateFromParams}
*/
public function GetParamForConfigArray()
{
$aDBParams = $this->Get('database');
$aParamValues = array(
'mode' => $this->Get('mode'),
'db_server' => $aDBParams['server'],
'db_user' => $aDBParams['user'],
'db_pwd' => $aDBParams['pwd'],
'db_name' => $aDBParams['name'],
'new_db_name' => $aDBParams['name'],
'db_prefix' => $aDBParams['prefix'],
'db_tls_enabled' => $aDBParams['db_tls_enabled'],
'db_tls_ca' => $aDBParams['db_tls_ca'],
'application_path' => $this->Get('url', ''),
'language' => $this->Get('language', ''),
'graphviz_path' => $this->Get('graphviz_path', ''),
'source_dir' => $this->Get('source_dir', ''),
);
return $aParamValues;
}
protected function Set($sCode, $value)
{
$this->aData[$sCode] = $value;
@@ -200,4 +225,5 @@ class XMLParameters extends Parameters
}
return $sRet;
}
}