// Check if given extension is active
function EXT_IS_ACTIVE ($ext_name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Extensions are all inactive during installation
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
$active = $cacheArray['extensions']['ext_active'][$ext_name];
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) {
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
// Load from database
}
// Get version from extensions
function GET_EXT_VERSION ($ext_name) {
- global $cacheArray, $_CONFIG, $cacheInstance;
+ global $cacheArray, $cacheInstance;
$ext_ver = false;
// Extensions are all inactive during installation
$ext_ver = $cacheArray['extensions']['ext_version'][$ext_name];
// Count cache hits
- if (getConfig('cache_hits') > 0) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
+ incrementConfigEntry('cache_hits');
} elseif (!is_object($cacheInstance)) {
// Load from database
$result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
// Get extension name from id
function GET_EXT_NAME ($ext_id) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Init extension name
$ret = "";
$ret = $cacheArray['extensions']['ext_name'][$ext_id];
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
// Get extension id from name
function GET_EXT_ID ($ext_name) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// Init ID number
$ret = 0;
$ret = $cacheArray['extensions']['ext_id'][$ext_name];
// Count cache hits
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (!EXT_IS_ACTIVE("cache")) {
// Load from database
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
// Checks if the module has a menu
function MODULE_HAS_MENU ($mod, $forceDb = false) {
- global $cacheArray, $_CONFIG;
+ global $cacheArray;
// All is false by default
$ret = false;
if (isset($cacheArray['modules']['has_menu'][$mod])) {
// Check module cache and count hit
$ret = ($cacheArray['modules']['has_menu'][$mod] == "Y");
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif (isset($cacheArray['extensions']['ext_menu'][$mod])) {
// Check cache and count hit
$ret = ($cacheArray['extensions']['ext_menu'][$mod] == "Y");
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ incrementConfigEntry('cache_hits');
} elseif ((IS_ADMIN()) && ($mod == "admin")) {
// Admin module has always a menu!
$ret = true;