Fix config creation

This commit is contained in:
Eric Espie
2026-04-14 17:01:54 +02:00
parent cbafcccde5
commit 662d6e3fb4
3 changed files with 11 additions and 4 deletions

View File

@@ -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 !!

View File

@@ -132,7 +132,8 @@ class ApplicationInstallSequencer extends StepSequencer
$sDataModelVersion,
$aSelectedModuleCodes,
$aSelectedExtensionCodes,
$sInstallComment
$sInstallComment,
$this->sSourceDesc
);
return $this->ComputeNextStep($sStep);

View File

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