From: Roland Häder Date: Thu, 5 Nov 2009 14:05:18 +0000 (+0000) Subject: Fix for 'Cache not found but ext-cache is active' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4085be6e8c521ed2d3d614baa391821583b5d6ab;p=mailer.git Fix for 'Cache not found but ext-cache is active' --- diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index f531cb40e8..5bcdf37ee2 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -765,17 +765,18 @@ function getExtensionName ($ext_id) { } // Get extension id from name -function getExtensionId ($ext_name, $forceDb = false) { +function getExtensionId ($ext_name) { // Init id number $ret = 0; + // Do we have cache? if (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) { // Load from cache $ret = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name]; // Count cache hits incrementStatsEntry('cache_hits'); - } elseif (($forceDb === true) || (!isExtensionActive('cache'))) { + } else { // Load from database $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", array($ext_name), __FUNCTION__, __LINE__); @@ -791,10 +792,7 @@ function getExtensionId ($ext_name, $forceDb = false) { // Cache it $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $ret; - } else { - // Caching enabled but no cache found is bad - debug_report_bug(__FUNCTION__ . ': Cache not found but ext-cache is active. ext_name=' . $ext_name); - } // END - if + } // Return value return $ret;