X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions-functions.php;h=c73a57fe4c3bc0d2adbbc45b50623c868a5f61d3;hb=65ed873eefdacdcea3331773b6458a06a5adff82;hp=e26f462871cd34ea878f7241832808b70cd0635c;hpb=039203d5428c9c6a3bed61fb3a9a16958c6fd44c;p=mailer.git diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index e26f462871..c73a57fe4c 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -226,7 +226,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru incrementExtensionUpdateIterator(); // Check for required file - if (loadExtension($ext_update, 'register', '', getExtensionDryRun())) { + if ((!isExtensionInstalled($ext_update)) && (loadExtension($ext_update, 'register', '', getExtensionDryRun()))) { // Set current extension name again setCurrentExtensionName($ext_name); @@ -254,12 +254,15 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru } // END - if } elseif ($ext_ver != getCurrentExtensionVersion()) { // Ok, update this extension now - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName().",ext_update=".$ext_update.",ext_ver=".$ext_ver."/".getCurrentExtensionVersion().""); - $GLOBALS['ext_backup'][$ext_update][$ext_ver] = getCurrentExtensionName(); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName='.getCurrentExtensionName().',currVer='.getCurrentExtensionVersion().''); + $GLOBALS['ext_backup_name'][$ext_update][$ext_ver] = getCurrentExtensionName(); + $GLOBALS['ext_backup_ver'][$ext_update][$ext_ver] = getCurrentExtensionVersion(); updateExtension($ext_update, $ext_ver, getExtensionDryRun()); - setCurrentExtensionName($GLOBALS['ext_backup'][$ext_update][$ext_ver]); - unset($GLOBALS['ext_backup'][$ext_update][$ext_ver]); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName().""); + setCurrentExtensionName($GLOBALS['ext_backup_name'][$ext_update][$ext_ver]); + setCurrentExtensionVersion($GLOBALS['ext_backup_ver'][$ext_update][$ext_ver]); + unset($GLOBALS['ext_backup_name'][$ext_update][$ext_ver]); + unset($GLOBALS['ext_backup_ver'][$ext_update][$ext_ver]); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName='.getCurrentExtensionName().',currVer='.getCurrentExtensionVersion().''); // All okay! $test = true; @@ -537,7 +540,7 @@ function getExtensionVersion ($ext_name, $force = false) { // Is the cache written? if (isset($GLOBALS['cache_array']['extension']['ext_version'][$ext_name])) { // Load data from cache - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": CACHE!"); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $ext_name . ': CACHE!'); $data['ext_version'] = $GLOBALS['cache_array']['extension']['ext_version'][$ext_name]; // Count cache hits @@ -546,15 +549,15 @@ function getExtensionVersion ($ext_name, $force = false) { // Load from database $result = SQL_QUERY_ESC("SELECT `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", array($ext_name), __FUNCTION__, __LINE__); - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": DB - ".SQL_NUMROWS($result).""); + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $ext_name . ': DB - '.SQL_NUMROWS($result).''); // Is the extension there? if (SQL_NUMROWS($result) == 1) { // Load entry $data = SQL_FETCHARRAY($result); } elseif (isDebugModeEnabled()) { - // Not found! - logDebugMessage(__FUNCTION__, __LINE__, sprintf(": Cannot find extension %s in database!", $ext_name)); + // Not found, please report all + debug_report_bug(sprintf(": Cannot find extension %s in database!", $ext_name)); } // Free result @@ -946,7 +949,7 @@ function ifModuleHasMenu ($mod, $forceDb = false) { // All is false by default $ret = false; - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "mod={$mod},cache=".getExtensionVersion('cache')); + // Extension installed and newer than or has version 0.1.2? if (isExtensionInstalledAndNewer('cache', '0.1.2')) { // Cache version is okay, so let's check the cache! if (isset($GLOBALS['cache_array']['modules']['has_menu'][$mod])) { @@ -986,7 +989,6 @@ function ifModuleHasMenu ($mod, $forceDb = false) { } // Return status - //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName().intval($ret)); return $ret; } @@ -1553,7 +1555,7 @@ function isExtensionIncludeReadable ($ext_name = '') { } // END - if // Return result - //* DEBUG: */ print __FUNCTION__.': '.$ext_name.'='.intval($GLOBALS['ext_inc_readable'][$ext_name]).'
'; + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',realable='.intval($GLOBALS['ext_inc_readable'][$ext_name])); return $GLOBALS['ext_inc_readable'][$ext_name]; }