aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-20 19:32:44 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-20 19:32:44 +0000
commit8b13885cf31c84249bd5977376707737083cc630 (patch)
treeac6a192c15ec1e885ca2a2af8aead031ce3e544a /engine
parentdf908277c1ae9913eeed2b9365646d20b54f8a44 (diff)
downloadelgg-8b13885cf31c84249bd5977376707737083cc630.tar.gz
elgg-8b13885cf31c84249bd5977376707737083cc630.tar.bz2
cleaned up logic on db query cache
git-svn-id: http://code.elgg.org/elgg/trunk@3773 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/database.php9
1 files changed, 7 insertions, 2 deletions
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();
}