debug_report_bug() should be used as a replacement for app_die() calls
[mailer.git] / inc / extensions-functions.php
index 8703d98ac301b91b63f17701d6b5f3c7d6aa1021..8d981e3e24580047b42e35c56ab4758012a16840 100644 (file)
@@ -207,7 +207,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                // Still zero and not in dry-run?
                if (($task_id == '0') && (!getExtensionDryRun())) {
                        // Then request a bug report
-                       debug_report_bug(sprintf("%s: task_id is still zero after determineExtensionTaskId(%s)",
+                       debug_report_bug(__FUNCTION__, __LINE__, sprintf("%s: task_id is still zero after determineExtensionTaskId(%s)",
                                __FUNCTION__,
                                getCurrentExtensionName()
                        ));
@@ -537,7 +537,7 @@ function isExtensionActive ($ext_name) {
                incrementStatsEntry('cache_hits');
        } elseif (isset($GLOBALS['ext_loaded'][$ext_name])) {
                // @TODO Extension is loaded, what next?
-               app_die(__FUNCTION__, __LINE__, 'LOADED:' . $ext_name);
+               debug_report_bug(__FUNCTION__, __LINE__, 'LOADED:' . $ext_name);
        } elseif (($ext_name == 'cache') || (!isExtensionInstalled('cache'))) {
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
                // Load from database
@@ -604,7 +604,7 @@ function getExtensionVersion ($ext_name, $force = false) {
                        $data = SQL_FETCHARRAY($result);
                } elseif (isDebugModeEnabled()) {
                        // Not found, please report all
-                       debug_report_bug(sprintf(": Cannot find extension %s in database!", $ext_name));
+                       debug_report_bug(__FUNCTION__, __LINE__, sprintf(": Cannot find extension %s in database!", $ext_name));
                }
 
                // Free result
@@ -617,7 +617,7 @@ function getExtensionVersion ($ext_name, $force = false) {
        // Extension version should not be invalid
        if (($data['ext_version'] == 'false') && ($force === false)) {
                // Please report this trouble
-               debug_report_bug(sprintf("Extension <span class=\"data\">%s</span> has empty version!", $ext_name));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Extension <span class=\"data\">%s</span> has empty version!", $ext_name));
        } // END - if
 
        // Return result
@@ -950,7 +950,7 @@ function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
                } // END - if
        } else {
                // Extension not there! :-(
-               debug_report_bug(sprintf("Extension <span class=\"data\">%s</span> not found but should be updated?", $ext_name));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Extension <span class=\"data\">%s</span> not found but should be updated?", $ext_name));
        }
 }
 
@@ -1202,7 +1202,7 @@ function addExtensionUpdateDependency ($updateDepends) {
        // Is the update depency empty? (NEED TO BE FIXED!)
        if (empty($updateDepends)) {
                // Please report this bug!
-               debug_report_bug('updateDepends is empty: currentExtension=' . getCurrentExtensionName());
+               debug_report_bug(__FUNCTION__, __LINE__, 'updateDepends is empty: currentExtension=' . getCurrentExtensionName());
        } // END - if
 
        // Is it not yet added?
@@ -1463,7 +1463,7 @@ function getExtensionSqls () {
        // Output debug backtrace if not found (SHOULD NOT HAPPEN!)
        if (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()])) {
                // Not found, should not happen
-               debug_report_bug(sprintf("ext_sqls is empty, current extension: %s",
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("ext_sqls is empty, current extension: %s",
                        getCurrentExtensionName()
                ));
        } // END - if
@@ -1560,7 +1560,7 @@ function setCurrentExtensionVersion ($ext_ver) {
        // ext_ver should never be empty in other modes than 'test'
        if ((empty($ext_ver)) && (getExtensionMode() != 'test')) {
                // Please report all these messages
-               debug_report_bug('ext_ver is empty. Current extension name: ' . getCurrentExtensionName() . ', mode=' . getExtensionMode());
+               debug_report_bug(__FUNCTION__, __LINE__, 'ext_ver is empty. Current extension name: ' . getCurrentExtensionName() . ', mode=' . getExtensionMode());
        } // END - if
 
        // Add version
@@ -1657,7 +1657,7 @@ function loadExtensionInclude () {
        // Is it readable?
        if (!isExtensionIncludeReadable()) {
                // Not readable
-               debug_report_bug('Extension ' . getCurrentExtensionName() . ' should be loaded, but is not readable.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Extension ' . getCurrentExtensionName() . ' should be loaded, but is not readable.');
        } // END - if
 
        // Generate INC name