mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Fix config creation
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
use Combodo\iTop\Application\Helper\Session;
|
||||
use Combodo\iTop\PhpParser\Evaluation\PhpExpressionEvaluator;
|
||||
use Combodo\iTop\Setup\FeatureRemoval\SetupAudit;
|
||||
use Combodo\iTop\Setup\ModuleDiscovery\ModuleFileReader;
|
||||
@@ -365,7 +364,7 @@ class RunTimeEnvironment
|
||||
* @throws \MySQLException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function DoCreateConfig(Config $oConfig, string $sDataModelVersion, array $aSelectedModuleCodes, array $aSelectedExtensionCodes, ?string $sInstallComment = null)
|
||||
public function DoCreateConfig(Config $oConfig, string $sDataModelVersion, array $aSelectedModuleCodes, array $aSelectedExtensionCodes, ?string $sInstallComment = null, string $sSourceDesc = 'Setup')
|
||||
{
|
||||
$oConfig->Set('access_mode', ACCESS_FULL);
|
||||
|
||||
@@ -376,6 +375,10 @@ class RunTimeEnvironment
|
||||
throw new Exception('Failed to record the installation information');
|
||||
}
|
||||
|
||||
$oConfig->UpdateIncludes($this->sBuildEnv);
|
||||
$sEnvironmentLabel = $this->GetFinalEnv().' (built on '.date('Y-m-d').')';
|
||||
$oConfig->Set('app_env_label', $sEnvironmentLabel, $sSourceDesc);
|
||||
|
||||
$this->WriteConfigFileSafe($oConfig);
|
||||
|
||||
// Ready to go !!
|
||||
|
||||
@@ -132,7 +132,8 @@ class ApplicationInstallSequencer extends StepSequencer
|
||||
$sDataModelVersion,
|
||||
$aSelectedModuleCodes,
|
||||
$aSelectedExtensionCodes,
|
||||
$sInstallComment
|
||||
$sInstallComment,
|
||||
$this->sSourceDesc
|
||||
);
|
||||
return $this->ComputeNextStep($sStep);
|
||||
|
||||
|
||||
@@ -27,14 +27,16 @@ abstract class StepSequencer
|
||||
protected Parameters $oParams;
|
||||
protected Config $oConfig;
|
||||
protected RunTimeEnvironment $oRunTimeEnvironment;
|
||||
protected string $sSourceDesc;
|
||||
|
||||
/**
|
||||
* @param \Parameters $oParams
|
||||
* @param \RunTimeEnvironment|null $oRunTimeEnvironment
|
||||
* @param string $sSourceDesc
|
||||
*
|
||||
* @throws \CoreException
|
||||
*/
|
||||
public function __construct(Parameters $oParams, ?RunTimeEnvironment $oRunTimeEnvironment = null)
|
||||
public function __construct(Parameters $oParams, ?RunTimeEnvironment $oRunTimeEnvironment = null, string $sSourceDesc = 'Setup')
|
||||
{
|
||||
if (is_null($oRunTimeEnvironment)) {
|
||||
$sEnvironment = $oParams->Get('target_env', 'production');
|
||||
@@ -49,6 +51,7 @@ abstract class StepSequencer
|
||||
$this->oConfig = new Config();
|
||||
$this->oConfig->UpdateFromParams($aParamValues);
|
||||
utils::SetConfig($this->oConfig);
|
||||
$this->sSourceDesc = $sSourceDesc;
|
||||
}
|
||||
|
||||
public function LogStep($sStep, $aResult)
|
||||
|
||||
Reference in New Issue
Block a user