}
// 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__);
// 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;