]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Even more rewrites to EL
[mailer.git] / inc / extensions-functions.php
index fd17c33bd1149abf4546e74a0e0356b404d271e4..8c52528550e4827bd31686598f57580e6a16d1f7 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run = false) {
        // If this happens twice, we need the bug report from you, except for updates/tests
        if ((isset($GLOBALS['loaded_extension'][$ext_name][$ext_mode])) && (!in_array($ext_mode, array('update', 'test')))) {
-               debug_report_bug(__FUNCTION__ . '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), true) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], true) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], true));
+               debug_report_bug(__FUNCTION__, __LINE__, '() is called twice: ext_name=' . $ext_name . ', ext_mode='. $ext_mode . ',ext_sqls=' . print_r(getExtensionSqls(), true) . ', ext_register_running=' . print_r($GLOBALS['ext_register_running'], true) . ', ext_running_updates=' . print_r($GLOBALS['ext_running_updates'], true));
        } // END - if
 
        // Make sure this situation can only happen once
@@ -377,11 +377,10 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                                // In normal mode return a true on success
                                $ret = true;
                        } elseif (getExtensionDryRun() === true) {
-                               // In  "dry-run" mode return array with all SQL commands
-                               $ret = getExtensionSqls();
+                               // In  "dry-run" mode do always return a true
+                               $ret = true;
 
                                // Re-init queries and notes
-                               initExtensionSqls(true);
                                initExtensionNotes();
                        } else {
                                // Extension has been removed for updates, so all is fine!
@@ -577,7 +576,7 @@ function getExtensionVersion ($ext_name, $force = false) {
        // Empty extension name should be fixed!
        if (empty($ext_name)) {
                // Please report this bug!
-               debug_report_bug(__FUNCTION__ . ': ext_name is empty which is not allowed here.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty which is not allowed here.');
        } // END - if
 
        // Extensions are all inactive during installation
@@ -773,7 +772,7 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
                $OUT = loadTemplate('admin_ext_sql_table', true, $content);
        } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
                // No addional SQL commands to run
-               $OUT = loadTemplate('admin_settings_saved', true, getMessage('ADMIN_NO_ADDITIONAL_SQLS'));
+               $OUT = loadTemplate('admin_settings_saved', true, '{--ADMIN_NO_ADDITIONAL_SQLS--}');
        } // END - if
 
        // Return output
@@ -810,7 +809,7 @@ function getExtensionName ($ext_id) {
        // Did we find some extension?
        if (empty($data['ext_name'])) {
                // We should fix these all!
-               debug_report_bug(__FUNCTION__ . ': ext_name is empty. ext_id=' . $ext_id);
+               debug_report_bug(__FUNCTION__, __LINE__, 'ext_name is empty. ext_id=' . $ext_id);
        } // END - if
 
        // Return the extension name
@@ -1209,7 +1208,7 @@ function addExtensionUpdateDependency ($updateDepends) {
        /* DEBUG:
        if ((isset($updateDepends, $GLOBALS['ext_running_updates'][getCurrentExtensionName()])) && (in_array($updateDepends, getExtensionUpdatesRunning()))) {
                // Double-adding isn't fine, too
-               debug_report_bug(__FUNCTION__ . '() called twice: updateDepends=' . $updateDepends . ',currentExtension=' . getCurrentExtensionName());
+               debug_report_bug(__FUNCTION__, __LINE__, '() called twice: updateDepends=' . $updateDepends . ',currentExtension=' . getCurrentExtensionName());
        } // END - if
        */
 
@@ -1243,7 +1242,7 @@ function initExtensionUpdateDependencies () {
        // Init update depency map automatically if not found
        if (isExtensionUpdateDependenciesInitialized()) {
                // We need these bug reports as well...
-               debug_report_bug(__FUNCTION__ . '() is called twice: currName=' . getCurrentExtensionName());
+               debug_report_bug(__FUNCTION__, __LINE__, '() is called twice: currName=' . getCurrentExtensionName());
        } // END - if
 
        $GLOBALS['ext_update_depends'][getCurrentExtensionName()] = array();
@@ -1260,7 +1259,7 @@ function addExtensionRunningRegistration ($ext_name) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Registration in progress: ext_name=' . $ext_name . ' - ENTERED!');
        if (isExtensionRegistrationRunning($ext_name)) {
                // This is really bad and should not be quietly ignored
-               debug_report_bug(__FUNCTION__ . '() already called! ext_name=' . $ext_name);
+               debug_report_bug(__FUNCTION__, __LINE__, '() already called! ext_name=' . $ext_name);
        } // END - if
 
        // Then add it!