From ec625722feb4da50848aac0b627b83b3bb0460a8 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 31 Dec 2009 03:58:21 +0000 Subject: Closes #1424: Faulty database migrations will now halt an upgrade. git-svn-id: http://code.elgg.org/elgg/trunk@3783 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/database.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/lib/database.php b/engine/lib/database.php index a3c93f48c..87b002508 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -65,7 +65,7 @@ function establish_db_link($dblinkname = "readwrite") { if (isset($CONFIG->db_disable_query_cache)) { $db_cache_off = $CONFIG->db_disable_query_cache; } - + // Set up cache if global not initialized and query cache not turned off if ((!$DB_QUERY_CACHE) && (!$db_cache_off)) { $DB_QUERY_CACHE = new ElggStaticVariableCache('db_query_cache'); //array(); @@ -97,7 +97,7 @@ function setup_db_connections() { */ function db_profiling_shutdown_hook() { global $dbcalls; - + elgg_log("DB Queries for this page: $dbcalls", 'DEBUG'); } @@ -552,11 +552,12 @@ function db_upgrade($version, $fromdir = "") { if (sizeof($sqlupgrades) > 0) { foreach($sqlupgrades as $sqlfile) { - try { +// let's not allow failing upgrade to pass. +// try { run_sql_script($fromdir . $sqlfile); - } catch (DatabaseException $e) { - error_log($e->getmessage()); - } +// } catch (DatabaseException $e) { +// error_log($e->getmessage()); +// } } } } -- cgit v1.2.3