]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions.php
Mahor rewrite:
[mailer.git] / inc / extensions.php
index b1c14b94dbf240e3f2737a7861353b975da4602b..76047df9841e2f6aea06482518a3ba9a962c9b77 100644 (file)
@@ -154,7 +154,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run=false) {
                        LOAD_EXTENSION($ext_name, "update", $ver, $dry_run);
 
                        // Do we have an update?
-                       if (((GET_EXT_VERSION("sql_patches") != "") && ($_CONFIG['verbose_sql'] == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
+                       if (((GET_EXT_VERSION("sql_patches") != "") && (getConfig('verbose_sql') == "Y")) || (!EXT_IS_ACTIVE("sql_patches"))) {
                                if (!empty($UPDATE_NOTES)) {
                                        // Update notes found
                                        $NOTES .= ("<div class=\"update_notes\"><strong>v".$ver.":</strong><br />".$UPDATE_NOTES."</div>");
@@ -402,7 +402,7 @@ function EXT_IS_ACTIVE ($ext_name) {
                $active = $cacheArray['extensions']['ext_active'][$ext_name];
 
                // Count cache hits
-               if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++;
+               if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
        } elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) {
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
                // Load from database
@@ -452,7 +452,7 @@ function GET_EXT_VERSION ($ext_name) {
                $ret = $cacheArray['extensions']['ext_version'][$ext_name];
 
                // Count cache hits
-               if (isset($_CONFIG['cache_hits'])) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
+               if (getConfig('cache_hits') > 0) $_CONFIG['cache_hits']++; else $_CONFIG['cache_hits'] = 1;
        } elseif (!is_object($cacheInstance)) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",
@@ -508,7 +508,7 @@ function EXTENSION_UPDATE ($file, $ext_name, $ext_ver, $dry_run=false) {
                        LOAD_EXTENSION($ext_name, "update", $ver, $dry_run);
 
                        // Add notes
-                       if ($_CONFIG['verbose_sql'] == "Y") {
+                       if (getConfig('verbose_sql') == "Y") {
                                if (!empty($UPDATE_NOTES)) {
                                        // Update notes found
                                        $NOTES .= ("<div class=\"update_notes\"><strong>v".$ver.":</strong><br />".$UPDATE_NOTES."</div>");
@@ -591,7 +591,7 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUT
        $OUT = "";
 
        // Do we have queries?
-       if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
+       if ((is_array($SQLs)) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) {
                $OUT  = "<div align=\"center\">
 <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"".$width."\" align=\"center\"".$dashed.">
 <tr>
@@ -615,7 +615,7 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUT
                }
        }
 
-       if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && ($_CONFIG['verbose_sql'] == "Y")) {
+       if ((!$S) && (GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) {
                // No addional SQL commands to run
                $OUT .= "<tr>
   <td colspan=\"2\" align=\"center\" class=\"switch_sw2 bottom2\" height=\"24\">
@@ -647,7 +647,7 @@ function GET_EXT_NAME ($ext_id) {
                $ret = $cacheArray['extensions']['ext_name'][$ext_id];
 
                // Count cache hits
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
        } elseif (!EXT_IS_ACTIVE("cache")) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT ext_name FROM "._MYSQL_PREFIX."_extensions WHERE id=%s LIMIT 1",
@@ -669,7 +669,7 @@ function GET_EXT_ID ($ext_name) {
                $ret = $cacheArray['extensions']['ext_id'][$ext_name];
 
                // Count cache hits
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
        } elseif (!EXT_IS_ACTIVE("cache")) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1",