mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
Code refactoring : fix of #876 implemented in 2.0.3 as [r3161], moved to a place where it will fix other implementations of the setup
SVN:trunk[4252]
This commit is contained in:
@@ -1000,10 +1000,6 @@ class ApplicationInstaller
|
|||||||
}
|
}
|
||||||
$oConfig->Set('source_dir', $sSourceDir);
|
$oConfig->Set('source_dir', $sSourceDir);
|
||||||
|
|
||||||
// Have it work fine even if the DB has been set in read-only mode for the users
|
|
||||||
$iPrevAccessMode = $oConfig->Get('access_mode');
|
|
||||||
$oConfig->Set('access_mode', ACCESS_FULL);
|
|
||||||
|
|
||||||
// Record which modules are installed...
|
// Record which modules are installed...
|
||||||
$oProductionEnv = new RunTimeEnvironment($sTargetEnvironment);
|
$oProductionEnv = new RunTimeEnvironment($sTargetEnvironment);
|
||||||
$oProductionEnv->InitDataModel($oConfig, true); // load data model and connect to the database
|
$oProductionEnv->InitDataModel($oConfig, true); // load data model and connect to the database
|
||||||
@@ -1013,9 +1009,6 @@ class ApplicationInstaller
|
|||||||
throw new Exception("Failed to record the installation information");
|
throw new Exception("Failed to record the installation information");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore the previous access mode
|
|
||||||
$oConfig->Set('access_mode', $iPrevAccessMode);
|
|
||||||
|
|
||||||
// Make sure the root configuration directory exists
|
// Make sure the root configuration directory exists
|
||||||
if (!file_exists(APPCONF))
|
if (!file_exists(APPCONF))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -596,6 +596,10 @@ class RunTimeEnvironment
|
|||||||
|
|
||||||
public function RecordInstallation(Config $oConfig, $sDataModelVersion, $aSelectedModules, $sModulesRelativePath, $sShortComment = null)
|
public function RecordInstallation(Config $oConfig, $sDataModelVersion, $aSelectedModules, $sModulesRelativePath, $sShortComment = null)
|
||||||
{
|
{
|
||||||
|
// Have it work fine even if the DB has been set in read-only mode for the users
|
||||||
|
$iPrevAccessMode = $oConfig->Get('access_mode');
|
||||||
|
$oConfig->Set('access_mode', ACCESS_FULL);
|
||||||
|
|
||||||
if ($sShortComment === null)
|
if ($sShortComment === null)
|
||||||
{
|
{
|
||||||
$sShortComment = 'Done by the setup program';
|
$sShortComment = 'Done by the setup program';
|
||||||
@@ -665,6 +669,10 @@ class RunTimeEnvironment
|
|||||||
$oInstallRec->Set('installed', $iInstallationTime);
|
$oInstallRec->Set('installed', $iInstallationTime);
|
||||||
$oInstallRec->DBInsertNoReload();
|
$oInstallRec->DBInsertNoReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore the previous access mode
|
||||||
|
$oConfig->Set('access_mode', $iPrevAccessMode);
|
||||||
|
|
||||||
// Database is created, installation has been tracked into it
|
// Database is created, installation has been tracked into it
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user