From 8b13885cf31c84249bd5977376707737083cc630 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 20 Dec 2009 19:32:44 +0000 Subject: cleaned up logic on db query cache git-svn-id: http://code.elgg.org/elgg/trunk@3773 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/database.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engine/lib/database.php') diff --git a/engine/lib/database.php b/engine/lib/database.php index 581998306..a3c93f48c 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -61,8 +61,13 @@ function establish_db_link($dblinkname = "readwrite") { // Set DB for UTF8 mysql_query("SET NAMES utf8"); - // Set up cache - if ((!$DB_QUERY_CACHE) && isset($CONFIG->db_disable_query_cache) && (!$CONFIG->db_disable_query_cache)) { + $db_cache_off = FALSE; + 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(); //$DB_QUERY_CACHE = select_default_memcache('db_query_cache'); //array(); } -- cgit v1.2.3