]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions.php
Global removed on many places, rewritten to use incrementConfigEntry()
[mailer.git] / inc / extensions.php
index 0e49343d0ac81b16312485f88395ff9b563964d6..5abc6756d5b67cdd79c5009cfc832eab431ea1eb 100644 (file)
@@ -329,7 +329,7 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
 
 // 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;
@@ -344,7 +344,7 @@ function EXT_IS_ACTIVE ($ext_name) {
                $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
@@ -377,7 +377,7 @@ function EXT_IS_ACTIVE ($ext_name) {
 }
 // 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
@@ -391,7 +391,7 @@ function GET_EXT_VERSION ($ext_name) {
                $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",
@@ -575,7 +575,7 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUT
 
 // Get extension name from id
 function GET_EXT_NAME ($ext_id) {
-       global $cacheArray, $_CONFIG;
+       global $cacheArray;
 
        // Init extension name
        $ret = "";
@@ -586,7 +586,7 @@ function GET_EXT_NAME ($ext_id) {
                $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",
@@ -599,7 +599,7 @@ function GET_EXT_NAME ($ext_id) {
 
 // Get extension id from name
 function GET_EXT_ID ($ext_name) {
-       global $cacheArray, $_CONFIG;
+       global $cacheArray;
 
        // Init ID number
        $ret = 0;
@@ -608,7 +608,7 @@ function GET_EXT_ID ($ext_name) {
                $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",
@@ -734,7 +734,7 @@ VALUES (0,0,'NEW','EXTENSION_DEACTIVATION','%s','%s',UNIX_TIMESTAMP())",
 
 // 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;
@@ -744,11 +744,11 @@ function MODULE_HAS_MENU ($mod, $forceDb = 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;