Explorar o código

Log the response file as a standalone XML file to be able to easily replay each installation

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2374 a333f486-631f-4898-b8df-5754b55c2be0
dflaven %!s(int64=12) %!d(string=hai) anos
pai
achega
e38980449c
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      setup/applicationinstaller.class.inc.php

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

@@ -130,6 +130,16 @@ class ApplicationInstaller
 				$sSafeXml = preg_replace("|<pwd>([^<]*)</pwd>|", "<pwd>**removed**</pwd>", $sXML);
 				SetupPage::log_info("======= Installation starts =======\nParameters:\n$sSafeXml\n");
 				
+				// Save the response file as a stand-alone file as well
+				$sFileName = 'install-'.date('Y-m-d');
+				$index = 0;
+				while(file_exists(APPROOT.'log/'.$sFileName.'.xml'))
+				{
+					$index++;
+					$sFileName = 'install-'.date('Y-m-d').'-'.$index;
+				}
+				file_put_contents(APPROOT.'log/'.$sFileName.'.xml', $sSafeXml);
+				
 				break;
 				
 				case 'copy':