]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Even more fixes/improvements:
[mailer.git] / inc / extensions-functions.php
index 14c1e82b4f7e95562045638403c4e63915d04389..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 <strong>%s</strong> 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
@@ -939,7 +939,7 @@ function isExtensionOlder ($ext_name, $ext_ver) {
 // Creates a new task for updated extension
 function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
        // Create subject line
-       $subject = '[UPDATE-' . $ext_name . '-' . $ext_ver . ':] {--ADMIN_UPDATE_EXT_SUBJ--}';
+       $subject = '[UPDATE-' . $ext_name . '-' . $ext_ver . ':] {--ADMIN_UPDATE_EXTENSION_SUBJ--}';
 
        // Is the extension there?
        if (isExtensionInstalled($ext_name)) {
@@ -950,7 +950,7 @@ function createExtensionUpdateTask ($adminId, $ext_name, $ext_ver, $notes) {
                } // END - if
        } else {
                // Extension not there! :-(
-               debug_report_bug(sprintf("Extension <strong>%s</strong> 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));
        }
 }
 
@@ -959,7 +959,7 @@ function createNewExtensionTask ($adminId, $subject, $ext) {
        // Not installed and do we have created a task for the admin?
        if ((determineTaskIdBySubject($subject) == '0') && (!isExtensionInstalled($ext))) {
                // Set default message if ext-foo is missing
-               $message = getMaskedMessage('ADMIN_EXT_TEXT_FILE_MISSING', $ext);
+               $message = getMaskedMessage('ADMIN_EXTENSION_TEXT_FILE_MISSING', $ext);
 
                // Template file
                $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
@@ -990,7 +990,7 @@ function createExtensionDeactivationTask ($ext) {
        // Not installed and do we have created a task for the admin?
        if ((determineTaskIdBySubject($subject) == '0') && (isExtensionInstalled($ext))) {
                // Task not created so add it
-               createNewTask($subject, SQL_ESCAPE(loadTemplate('task_ext_deactivated', true, $ext)), 'EXTENSION_DEACTIVATION');
+               createNewTask($subject, SQL_ESCAPE(loadTemplate('task_EXTENSION_deactivated', true, $ext)), 'EXTENSION_DEACTIVATION');
        } // END - if
 }
 
@@ -1121,7 +1121,7 @@ function addExtensionNotes ($ver) {
                }
 
                // Load template
-               $out = loadTemplate('admin_ext_notes', true, $content);
+               $out = loadTemplate('admin_EXTENSION_notes', true, $content);
        } // END - if
 
        // Add the notes
@@ -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?
@@ -1427,17 +1427,17 @@ function getExtensionNotes () {
 
 // Setter for current extension name
 function setCurrentExtensionName ($ext_name) {
-       $GLOBALS['curr_ext_name'] = (string) trim($ext_name);
+       $GLOBALS['curr_EXTENSION_name'] = (string) trim($ext_name);
 }
 
 // Getter for current extension name
 function getCurrentExtensionName () {
-       if (isset($GLOBALS['curr_ext_name'])) {
-               return $GLOBALS['curr_ext_name'];
+       if (isset($GLOBALS['curr_EXTENSION_name'])) {
+               return $GLOBALS['curr_EXTENSION_name'];
        } // END - if
 
        // Not set!
-       debug_report_bug(__FUNCTION__.": curr_ext_name not initialized. Please execute initExtensionSqls() before calling this function.");
+       debug_report_bug(__FUNCTION__.": curr_EXTENSION_name not initialized. Please execute initExtensionSqls() before calling this function.");
 }
 
 // Init SQLs array for current extension
@@ -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