From 8d1c6e1cd4387cb6e389b42f27838a63593c0edf Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 13 Jul 2010 03:30:14 +0000 Subject: [PATCH] Add an option to bypass the actual db version update write to the database, so for testing the same update can be applied over and over without needing to update the db. --- db/db_update.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/db/db_update.php b/db/db_update.php index 35c6b01..36996b6 100644 --- a/db/db_update.php +++ b/db/db_update.php @@ -6,7 +6,7 @@ if(!function_exists("system")) { //include the config.inc.php //so we have the db connection info -require("../data/config.inc.php"); +require_once('../data/config.inc.php'); echo "
\n";
 if(file_exists("db.code.version.txt")) {
 	$dbcodeversion_file=file("db.code.version.txt");
@@ -17,6 +17,8 @@ else {
 	exit;
 }
 
+$skip_dbversion_update = array_key_exists('skip_dbversion_update', $_GET);
+
 mysql_connect($DBHOST,$DBUSER,$DBPASS);
 mysql_select_db($DBNAME);
 @mysql_query("SET NAMES utf8");
@@ -98,8 +100,13 @@ if($dbcodeversion && $dbdbversion) {
 			config_update_variables();
 		}
 
-		echo "\nAll done - updating new DB version to $dbcodeversion\n";
-		mysql_query("UPDATE config SET val='$dbcodeversion' WHERE var='DBVERSION' AND conferences_id='0'");
+
+		if($skip_dbversion_update) {
+			echo "\nAll done - skip_dbversion_update specified, NOT updating to DB version to $dbcodeversion\n";
+		} else {
+			echo "\nAll done - updating new DB version to $dbcodeversion\n";
+			mysql_query("UPDATE config SET val='$dbcodeversion' WHERE var='DBVERSION' AND conferences_id='0'");
+		}
 	}
 }
 else {