Fix for 'Cache not found but ext-cache is active'
authorRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2009 14:05:18 +0000 (14:05 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 5 Nov 2009 14:05:18 +0000 (14:05 +0000)
inc/extensions-functions.php

index f531cb40e88894a34561b725c8e9c6c695c09cdf..5bcdf37ee2920623867fd033ca2bc0b8d970ae3a 100644 (file)
@@ -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;