From 7aae7aa8325f660cbe1e238f3062550a0c2ba5bf Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 7 Feb 2014 20:13:02 +0100 Subject: [PATCH] Cache of database "queries" can now be disabled (default). Please note, that if you enable this, this may lead to wrong results as this is not fully stable. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/database/class_BaseDatabaseWrapper.php | 2 +- inc/config.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/classes/main/database/class_BaseDatabaseWrapper.php b/inc/classes/main/database/class_BaseDatabaseWrapper.php index 1f8ad032..9430c6ac 100644 --- a/inc/classes/main/database/class_BaseDatabaseWrapper.php +++ b/inc/classes/main/database/class_BaseDatabaseWrapper.php @@ -149,7 +149,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys); // Does this key exists in cache? - if ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1)) { + if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) { // Debug message /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), TRUE)); diff --git a/inc/config.php b/inc/config.php index 18f58c0b..868f53fd 100644 --- a/inc/config.php +++ b/inc/config.php @@ -353,5 +353,8 @@ $cfg->setConfigEntry('proxy_connect_method', 'Y'); // CFG: HOSTNAME-FILE $cfg->setConfigEntry('hostname_file', '/etc/hostname'); +// CFG: DATABASE-CACHE-ENABLED +$cfg->setConfigEntry('database_cache_enabled', FALSE); + // [EOF] ?> -- 2.30.2