]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Fixes
[mailer.git] / inc / extensions-functions.php
index d1c46faf4268dd058cbff96565b9b3b3cff96954..da77d2f802cb47b02330883aa41d8af65561d07d 100644 (file)
@@ -199,8 +199,8 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $ignoreUpdates
        // When this extension is already in registration/update phase, all is fine
        if ((isExtensionRegistrationRunning($ext_name)) || ((isExtensionUpdateRunning($ext_name)) && ($ignoreUpdates === false))) {
                // Then abort here with 'true' becaus it is fine
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in registration/update phase, all fine.');
-               ///* BUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',taskId=' . $taskId . ',dry_run=' . intval($dry_run) . ' - Please investigate!');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in registration/update phase, all fine,taskId=' . $taskId . ',dry_run=' . intval($dry_run) . ',ignoreUpdates=' . intval($ignoreUpdates));
+               ///* BUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',taskId=' . $taskId . ',dry_run=' . intval($dry_run) . ',ignoreUpdates=' . intval($ignoreUpdates) . ' - Please investigate!');
                return true;
        } // END - if
 
@@ -359,7 +359,7 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $ignoreUpdates
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // New way, with CSS
                                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . getCurrentExtensionName() . ',always_active=' . getThisExtensionAlwaysActive() . ', ext_ver=' . getCurrentExtensionVersion() . 'ext_css=' . getExtensionHasCss());
-                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_extensions` (`ext_name`, `ext_active`, `ext_version`,`ext_has_css`) VALUES ('%s','%s','%s','%s')",
+                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_extensions` (`ext_name`, `ext_active`, `ext_version`, `ext_has_css`) VALUES ('%s','%s','%s','%s')",
                                                array(
                                                        getCurrentExtensionName(),
                                                        getThisExtensionAlwaysActive(),
@@ -613,7 +613,7 @@ function getExtensionVersion ($ext_name, $force = false) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - Checking cache ...');
        if (isset($GLOBALS['cache_array']['extension']['ext_version'][$ext_name])) {
                // Load data from cache
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ': CACHE!');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - CACHE!');
                $data['ext_version'] = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name];
 
                // Count cache hits
@@ -664,9 +664,10 @@ function updateExtension ($ext_name, $ext_ver, $dry_run = false) {
        setCurrentExtensionName($ext_name);
 
        // Is this extension update already running?
-       if (isExtensionUpdateRunning($ext_name)) {
+       if ((isExtensionUpdateRunning($ext_name)) && ($dry_run === false)) {
                // This is fine but needs logging ATM
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in update phase, all fine.');
+               ///* BUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ' - already in update phase, please investigate!');
                return true;
        } // END - if
 
@@ -727,11 +728,11 @@ function updateExtension ($ext_name, $ext_ver, $dry_run = false) {
                                        } // END - if
                                } // END - foreach
 
-                               // Set extension version here
-                               setCurrentExtensionVersion($ext_ver);
-
                                // Set name back
                                setCurrentExtensionName($ext_name);
+
+                               // Set extension version here
+                               setCurrentExtensionVersion($ext_ver);
                        } // END - if
 
                        // Add notes
@@ -1320,13 +1321,13 @@ function isExtensionUpdateRunning ($ext_name) {
                        if (($ext1 == $ext_name) || (in_array($ext_name, $depends))) {
                                // Found
                                $isRunning = true;
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',isRunning=' . intval($isRunning) . ' - ADDED!');
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext1=' . $ext1 . ',ext_name=' . $ext_name . ',isRunning=true - ADDED!');
                                break;
                        } // END - if
                } // END - foreach
 
                // Return result
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ', isRunning=' . intval($isRunning) . ' - EXIT!');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currentExtension=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ', isRunning=' . intval($isRunning) . ' - ALT-EXIT!');
                return $isRunning;
        } // END - if
 
@@ -1792,7 +1793,7 @@ function addAdminMenuSql ($action, $what, $title, $descr, $sort) {
                // Is what null?
                if (is_null($what)) {
                        // Add main menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('%s',NULL,'%s','%s',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`, `what`, `title`, `descr`, `sort`) VALUES ('%s',NULL,'%s','%s',%s)",
                                $action,
                                $title,
                                $descr,
@@ -1800,7 +1801,7 @@ function addAdminMenuSql ($action, $what, $title, $descr, $sort) {
                        );
                } else {
                        // Add sub menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('%s','%s','%s','%s',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`, `what`, `title`, `descr`, `sort`) VALUES ('%s','%s','%s','%s',%s)",
                                $action,
                                $what,
                                $title,
@@ -1824,14 +1825,14 @@ function addGuestMenuSql ($action, $what, $title, $sort) {
                // Is what null?
                if (is_null($what)) {
                        // Add main menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s',NULL,'%s','N','Y',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`, `what`, `title`, `visible`, `locked`, `sort`) VALUES ('%s',NULL,'%s','N','Y',%s)",
                                $action,
                                $title,
                                bigintval($sort)
                        );
                } else {
                        // Add sub menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s','%s','%s','N','Y',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`, `what`, `title`, `visible`, `locked`, `sort`) VALUES ('%s','%s','%s','N','Y',%s)",
                                $action,
                                $what,
                                $title,
@@ -1843,7 +1844,7 @@ function addGuestMenuSql ($action, $what, $title, $sort) {
                addExtensionSql($sql);
        } elseif (isDebugModeEnabled()) {
                // Double menus should be located and fixed!
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double guest menu action=%s,what=%s,title=%s,locked=%s,visible=%s detected.", $action, $what, $title, $locked, $visible));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double guest menu action=%s,what=%s,title=%s detected.", $action, $what, $title));
        }
 }
 
@@ -1854,14 +1855,14 @@ function addMemberMenuSql ($action, $what, $title, $sort) {
                // Is what null?
                if (is_null($what)) {
                        // Add main menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s',NULL,'%s','N','Y',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`, `what`, `title`, `visible`, `locked`, `sort`) VALUES ('%s',NULL,'%s','N','Y',%s)",
                                $action,
                                $title,
                                bigintval($sort)
                        );
                } else {
                        // Add sub menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s','%s','%s','N','Y',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`, `what`, `title`, `visible`, `locked`, `sort`) VALUES ('%s','%s','%s','N','Y',%s)",
                                $action,
                                $what,
                                $title,
@@ -1873,7 +1874,7 @@ function addMemberMenuSql ($action, $what, $title, $sort) {
                addExtensionSql($sql);
        } elseif (isDebugModeEnabled()) {
                // Double menus should be located and fixed!
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double member menu action=%s,what=%s,title=%s,visivle=%s,locked=%s detected.", $action, $what, $title, $visible, $locked));
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double member menu action=%s,what=%s,title=%s detected.", $action, $what, $title));
        }
 }
 
@@ -1884,7 +1885,7 @@ function addSponsorMenuSql ($action, $what, $title, $active, $sort) {
                // Is what null?
                if (is_null($what)) {
                        // Add main menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES('%s',NULL,'%s','%s',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('%s',NULL,'%s','%s',%s)",
                                $action,
                                $title,
                                $active,
@@ -1892,7 +1893,7 @@ function addSponsorMenuSql ($action, $what, $title, $active, $sort) {
                        );
                } else {
                        // Add sub menu
-                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES('%s','%s','%s','%s',%s)",
+                       $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('%s','%s','%s','%s',%s)",
                                $action,
                                $what,
                                $title,