mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2013 Setup : fix crash on compilation if initial DB info were wrong
Use case : - having in the iTop config file wrong DB parameters (unreachable server for example) - launch the setup in update mode - fix the DB config in the wizard The PR #351 solved the errors that were happening in the following steps. But we still had an error during compilation, caused by the maintenance mode activation.
This commit is contained in:
@@ -2473,6 +2473,8 @@ class Config
|
||||
* @param string|null $sModulesDir
|
||||
* @param bool $bPreserveModuleSettings
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \CoreException
|
||||
*/
|
||||
|
||||
@@ -286,8 +286,9 @@ class ApplicationInstaller
|
||||
}
|
||||
}
|
||||
|
||||
$aParamValues = $this->oParams->GetParamForConfigArray();
|
||||
self::DoCompile($aSelectedModules, $sSourceDir, $sExtensionDir, $sTargetDir, $sTargetEnvironment,
|
||||
$bUseSymbolicLinks);
|
||||
$bUseSymbolicLinks, $aParamValues);
|
||||
|
||||
$aResult = array(
|
||||
'status' => self::OK,
|
||||
@@ -510,7 +511,22 @@ class ApplicationInstaller
|
||||
}
|
||||
|
||||
|
||||
protected static function DoCompile($aSelectedModules, $sSourceDir, $sExtensionDir, $sTargetDir, $sEnvironment, $bUseSymbolicLinks = null)
|
||||
/**
|
||||
* @param array $aSelectedModules
|
||||
* @param string $sSourceDir
|
||||
* @param string $sExtensionDir
|
||||
* @param string $sTargetDir
|
||||
* @param string $sEnvironment
|
||||
* @param boolean $bUseSymbolicLinks
|
||||
* @param array $aParamValues
|
||||
*
|
||||
* @return void
|
||||
* @throws \ConfigException
|
||||
* @throws \CoreException
|
||||
*
|
||||
* @since 3.1.0 N°2013 added the aParamValues param
|
||||
*/
|
||||
protected static function DoCompile($aSelectedModules, $sSourceDir, $sExtensionDir, $sTargetDir, $sEnvironment, $bUseSymbolicLinks = null, $aParamValues = [])
|
||||
{
|
||||
SetupLog::Info("Compiling data model.");
|
||||
|
||||
@@ -520,7 +536,7 @@ class ApplicationInstaller
|
||||
|
||||
if (empty($sSourceDir) || empty($sTargetDir)) {
|
||||
throw new Exception("missing parameter source_dir and/or target_dir");
|
||||
}
|
||||
}
|
||||
|
||||
$sSourcePath = APPROOT.$sSourceDir;
|
||||
$aDirsToScan = array($sSourcePath);
|
||||
@@ -554,6 +570,7 @@ class ApplicationInstaller
|
||||
{
|
||||
$oConfig = null;
|
||||
}
|
||||
$oConfig->UpdateFromParams($aParamValues);
|
||||
SetupUtils::EnterMaintenanceMode($oConfig);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user