Browse Source

Setup: fixed issue when upgrading a DB (no install dir specified, thus no config file) and requesting a backup: the backup is created without the config file in it.
(Updated the readme for the upcoming release!)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3037 a333f486-631f-4898-b8df-5754b55c2be0

romainq 11 năm trước cách đây
mục cha
commit
eb36832ea7
2 tập tin đã thay đổi với 14 bổ sung11 xóa
  1. 1 1
      readme.txt
  2. 13 10
      setup/backup.class.inc.php

+ 1 - 1
readme.txt

@@ -373,7 +373,7 @@ Portal security enhancements:
 #851 Ampersand (aka '&') not welcomed in the setup wizard
 PHP Mail transport to allow 100% of recipients in BCC (regression introduced in 2.0.1)
 Regression of 2.0.2 beta: Configure this list + discard all columns: the list cannot be loaded anymore (if saved)
-
+Setup: fixed issue when upgrading a DB (no install dir specified, thus no config file) and requesting a backup: the backup is created without the config file in it.
 
 3.2. Known limitations (https://sourceforge.net/apps/trac/itop/report/3)
      -----------------

+ 13 - 10
setup/backup.class.inc.php

@@ -112,23 +112,26 @@ class DBBackup
 		$sDataFile = tempnam(SetupUtils::GetTmpDir(), 'itop-');
 		$this->LogInfo("Data file: '$sDataFile'");
 
+		$aContents = array();
+		$aContents[] = array(
+			'source' => $sDataFile,
+			'dest' => 'itop-dump.sql',
+		);
+
 		if (is_null($sSourceConfigFile))
 		{
 			$sSourceConfigFile = MetaModel::GetConfig()->GetLoadedFile();
 		}
+		if (!empty($sSourceConfigFile))
+		{
+			$aContents[] = array(
+				'source' => $sSourceConfigFile,
+				'dest' => 'config-itop.php',
+			);
+		}
 
 		$this->DoBackup($sDataFile);
 
-		$aContents = array(
-			array(
-				'source' => $sDataFile,
-				'dest' => 'itop-dump.sql',
-			),
-			array(
-				'source' => $sSourceConfigFile,
-				'dest' => 'config-itop.php',
-			),
-		);
 		$sDeltaFile = APPROOT.'data/'.utils::GetCurrentEnvironment().'.delta.xml';
 		if (file_exists($sDeltaFile))
 		{