Rewrites of debug lines, possible fix for extension installation bug
[mailer.git] / inc / functions.php
index 8ae2ab07d0ee3797abdb55f3403b84807867f788..178dfb30eb0acc64556cafe05851e5ba03d3b7dc 100644 (file)
@@ -907,11 +907,14 @@ function LOAD_URL ($URL, $addUrlData=true) {
        if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) {
                // Make all URLs full-qualified
                $URL = "".$URL;
        if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) {
                // Make all URLs full-qualified
                $URL = "".$URL;
-       }
+       } // END - if
 
 
-       // Get output buffer
+       // Three different debug ways...
        //* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL);
        //* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL);
+       //* DEBUG: */ die($URL);
+
+       // Get output buffer
        $OUTPUT = ob_get_contents();
 
        // Clear it only if there is content
        $OUTPUT = ob_get_contents();
 
        // Clear it only if there is content
@@ -939,6 +942,8 @@ function LOAD_URL ($URL, $addUrlData=true) {
                LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL));
                LOAD_INC("inc/footer.php");
        }
                LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL));
                LOAD_INC("inc/footer.php");
        }
+
+       // Shut the mailer down here
        shutdown();
 }
 
        shutdown();
 }
 
@@ -3098,7 +3103,7 @@ function DEBUG_LOG ($funcFile, $line, $message, $force=true) {
 
                // Log this message away
                $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!");
 
                // Log this message away
                $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!");
-               fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename($funcFile)."|".$line."|".strip_tags($message)."\n");
+               fwrite($fp, date("d.m.Y|H:i:s", time())."|".$GLOBALS['module']."|".basename($funcFile)."|".$line."|".strip_tags($message)."\n");
                fclose($fp);
        } // END - if
 }
                fclose($fp);
        } // END - if
 }