Bläddra i källkod

#876 Upgrade finishes with error "Cannot reload object id = -1" (root cause: DB in read-only mode, see config/access_mode)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3161 a333f486-631f-4898-b8df-5754b55c2be0
romainq 11 år sedan
förälder
incheckning
6f18762414
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      setup/applicationinstaller.class.inc.php

+ 6 - 0
setup/applicationinstaller.class.inc.php

@@ -901,6 +901,10 @@ class ApplicationInstaller
 		}
 		$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...
 		$oProductionEnv = new RunTimeEnvironment($sTargetEnvironment);
 		$oProductionEnv->InitDataModel($oConfig, true);  // load data model and connect to the database
@@ -910,6 +914,8 @@ class ApplicationInstaller
 			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
 		if (!file_exists(APPCONF))