debug_report_bug() should be used as a replacement for app_die() calls
authorRoland Häder <roland@mxchange.org>
Sun, 6 Jun 2010 17:41:09 +0000 (17:41 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 6 Jun 2010 17:41:09 +0000 (17:41 +0000)
35 files changed:
inc/classes/cachesystem.class.php
inc/code-functions.php
inc/config-functions.php
inc/db/lib-mysql3.php
inc/extensions-functions.php
inc/extensions/ext-sql_patches.php
inc/filter-functions.php
inc/filters.php
inc/functions.php
inc/handler.php
inc/inc-functions.php
inc/install-inc.php
inc/libs/admins_functions.php
inc/libs/bonus_functions.php
inc/libs/network_functions.php
inc/libs/online_functions.php
inc/libs/register_functions.php
inc/libs/surfbar_functions.php
inc/libs/theme_functions.php
inc/libs/yoomedia_functions.php
inc/load_config.php
inc/loader/load_cache-modules.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-add_guestnl_cat.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_task.php
inc/modules/guest/what-confirm.php
inc/modules/guest/what-stats.php
inc/mysql-manager.php
inc/revision-functions.php
inc/stylesheet.php
inc/wrapper-functions.php
mailid.php
mailid_top.php

index 5892900b3d8c7ec4f5344386e7061a9f8a28a05c..4c4878aa574e6b4811b44e785b5b58d6dc2007e8 100644 (file)
@@ -108,7 +108,7 @@ class CacheSystem {
 
                        // Create file
                        if ($this->isCacheReadable()) changeMode($this->fqfn, 0666);
-                       $this->pointer = fopen($this->fqfn, 'w') or app_die(__METHOD__, __LINE__, "Cannot write to cache ".$this->fqfn." !");
+                       $this->pointer = fopen($this->fqfn, 'w') or debug_report_bug(__METHOD__, __LINE__, 'Cannot write to cache ' . $this->fqfn . ' !');
 
                        // Add open PHP tag
                        fwrite($this->pointer, "<?php\n");
@@ -188,7 +188,7 @@ class CacheSystem {
                                        $this->removeCacheFile(true);
 
                                        // Unsupported cache found!
-                                       debug_report_bug('Unsupported cache ' . $this->name . ' detected.');
+                                       debug_report_bug(__METHOD__, __LINE__, 'Unsupported cache ' . $this->name . ' detected.');
                                }
 
                                // Write cache line to file
@@ -260,7 +260,7 @@ class CacheSystem {
                        } // END - if
                } else {
                        // Cache file not found or not readable
-                       debug_report_bug($this->name);
+                       debug_report_bug(__METHOD__, __LINE__, $this->name);
                        addFatalMessage(__METHOD__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMaskedMessage('CACHE_CANNOT_LOAD', $this->fqfn));
 
                        // Try to remove it
@@ -500,7 +500,7 @@ class CacheSystem {
                        }
                } elseif (isset($value[0])) {
                        // These lines needs fixing
-                       debug_report_bug('Invalid entry with [0] found. key=' . $key);
+                       debug_report_bug(__METHOD__, __LINE__, 'Invalid entry with [0] found. key=' . $key);
                } else {
                        // Non-string
                        $line = '$this->' . $prefix . "['" . $this->name . "']['" . $key . "']" . $extender . ' = ' . $value . ";\n";
index 6670ed1cf6c5c07494969467e34d9acf7359860c..4f4156fe351c21beccfb1dbc8d926986c0c80cfe 100644 (file)
@@ -52,7 +52,7 @@ function getCode ($key) {
        // Is the key set?
        if (!isCodeSet($key)) {
                // Abort here
-               debug_report_bug(sprintf("%s[%s:] Code %s is not set.",
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("%s[%s:] Code %s is not set.",
                        __FUNCTION__,
                        __LINE__,
                        $key
index bc3eea007071a28706792fa977eac94d557114af..b58db19ee5185156463c8ce4a631a889d5d17520 100644 (file)
@@ -47,7 +47,7 @@ function initConfig () {
        // Init not if already found
        if (isConfigurationLoaded()) {
                // Already initialized
-               debug_report_bug(sprintf("[%s:%s] Configuration is already initialized.", __FUNCTION__, __LINE__));
+               debug_report_bug(__FUNCTION__, __LINE__, 'Configuration is already initialized.');
        } // END - if
 
        // Set a minimum of configuration, required to by-pass some error triggers in getConfig()
@@ -79,11 +79,7 @@ function getConfig ($configEntry) {
        // Is the entry there?
        if (!isset($GLOBALS['config'][$configEntry])) {
                // Raise an error of missing entries
-               debug_report_bug(sprintf("[%s:%s] Configuration entry <em>%s</em> is missing.",
-                       __FUNCTION__,
-                       __LINE__,
-                       $configEntry
-               ));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Configuration entry <em>%s</em> is missing.", $configEntry));
        } // END - if
 
        // Return it
@@ -298,7 +294,7 @@ function updateConfiguration ($entries, $values, $updateMode='', $config = '0')
                                // Check if string or number but no array
                                if (is_array($values[$idx])) {
                                        // Arrays must be fixed...
-                                       debug_report_bug('values[' . $idx . '] should not be an array! Content=<pre>'.print_r($values[$idx], true).'</pre>');
+                                       debug_report_bug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=<pre>'.print_r($values[$idx], true).'</pre>');
                                } elseif (($values[$idx] + 0) === $values[$idx]) {
                                        // Number detected
                                        $all .= sprintf("`%s`=%s,", $entry, (float)$values[$idx]);
index 4f4b8cd0989c67d6fbadf6c02a587db58927357b..25a8307ccac534ebaaaab84e705ab48712e22cc0 100644 (file)
@@ -50,7 +50,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
        // Link is up?
        if (!SQL_IS_LINK_UP()) {
                // We should not quietly ignore this!
-               debug_report_bug(sprintf("Cannot query database: sqlString=%s,file=%s,line=%s",
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Cannot query database: sqlString=%s,file=%s,line=%s",
                        $sqlString,
                        basename($F),
                        $L
@@ -60,7 +60,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
                return false;
        } elseif (empty($sqlString)) {
                // Empty SQL string!
-               debug_report_bug(sprintf("SQL string is empty. Please fix this. file=%s, line=%s",
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("SQL string is empty. Please fix this. file=%s, line=%s",
                        basename($F),
                        $L
                ));
@@ -84,7 +84,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
        // Run SQL command
        //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '<br />');
        $result = mysql_query($sqlString, SQL_GET_LINK())
-               or debug_report_bug('[' . __FUNCTION__ . ':' . __LINE__ . '] ' . $F . ' (' . $L . '):' . mysql_error() . "\n".
+               or debug_report_bug(__FUNCTION__, __LINE__, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n".
 'Query string:' . $sqlString);
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sqlString . ',numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS());
 
@@ -108,7 +108,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
                //
                // Debugging stuff...
                //
-               $fp = fopen(getConfig('CACHE_PATH') . 'mysql.log', 'a') or app_die(__FILE__, __LINE__, 'Cannot write mysql.log!');
+               $fp = fopen(getConfig('CACHE_PATH') . 'mysql.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write mysql.log!');
                if (!isset($GLOBALS['sql_first_entry'])) {
                        // Write first entry
                        fwrite($fp, 'Module=' . getModule() . "\n");
@@ -283,7 +283,7 @@ function SQL_QUERY_ESC ($qstring, $data, $F, $L, $run=true, $strip=true, $secure
 
        // Debugging
        //
-       //* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
+       //* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, "Cannot write debug.log!");
        //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", ' ', $eval))."\n");
        //* DEBUG: */ fclose($fp);
 
@@ -340,7 +340,7 @@ function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) {
        // Is columns an array?
        if (!is_array($columns)) {
                // No array
-               debug_report_bug(sprintf("columns is not an array. %s != array, file=%s, line=%s",
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("columns is not an array. %s != array, file=%s, line=%s",
                        gettype($columns),
                        basename($F),
                        $L
@@ -397,7 +397,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
 
                        // Get column information
                        $result = SQL_QUERY_ESC("SHOW COLUMNS FROM `%s` LIKE '%s'",
-                               array($tableName, $columnName), __FILE__, __LINE__);
+                               array($tableName, $columnName), __FUNCTION__, __LINE__);
 
                        // Do we have no entry on ADD or an entry on DROP?
                        // 123           4       4     3    3      4           4          32    23           4       4     3    3      4            4          321
@@ -444,7 +444,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                } // END - if
 
                // Show indexes
-               $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__);
 
                // Non-skipping is default for ADD
                $skip = false;
@@ -515,7 +515,7 @@ function SQL_SET_LINK ($link) {
        // Is this a resource or null?
        if ((!is_resource($link)) && (!is_null($link))) {
                // This should never happen!
-               debug_report_bug(sprintf("link is not resource or null. Type: %s", gettype($link)));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("link is not resource or null. Type: %s", gettype($link)));
        } // END - if
 
        // Set it
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
index 68d4ea59e1767755c22b7e9e67001e2c69afdb96..da8113918188e63ddc660a381a7b8b00b77a29c9 100644 (file)
@@ -773,7 +773,7 @@ INDEX (`ip`)
                                updateConfiguration('file_hash', '');
 
                                // Cannot read secret file!
-                               app_die(__FILE__, __LINE__, 'Cannot read secret file! Please try to reload.');
+                               debug_report_bug(__FILE__, __LINE__, 'Cannot read secret file! Please try to reload.');
                        }
                } // END - if
 
index 39b7558bfd7e97c65d09e423c282a37e5ea49c9d..7c0296dad20c472114c501418ec3e4fc5c97a0f1 100644 (file)
@@ -47,7 +47,7 @@ function initFilterSystem () {
        // Is the filter already initialized?
        if (isset($GLOBALS['filter_init'])) {
                // Then abort here
-               debug_report_bug('Filter system already initialized.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Filter system already initialized.');
        } // END - if
 
        // Load all saved filers if sql_patches is updated
@@ -195,7 +195,7 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for
                // In installation phase we always want to abort
                if (($silentAbort === false) || (isInstallationPhase())) {
                        // Add fatal message
-                       debug_report_bug(sprintf("[%s:%s] Filter chain %s has already filter function %s registered!", __FUNCTION__, __LINE__, $filterName, $filterFunction));
+                       debug_report_bug(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered!", $filterName, $filterFunction));
                } // END - if
 
                // Abort here
index 4dcb9e3f0f0d3999e1f69a5f202980678eb6af65..424fe9f1048fe3fb6e7ef46971215bb7a7a2799a 100644 (file)
@@ -190,7 +190,7 @@ function FILTER_SOLVE_TASK ($data) {
                adminSolveTask($data['task_id']);
        } else {
                // Not detectable!
-               debug_report_bug(sprintf("Cannot resolve task. data[%s]=<pre>%s</pre>", gettype($data), print_r($data, true)));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Cannot resolve task. data[%s]=<pre>%s</pre>", gettype($data), print_r($data, true)));
        }
 
        // Return the data
@@ -202,7 +202,7 @@ function FILTER_LOAD_INCLUDES ($pool) {
        // Is it null?
        if (is_null($pool)) {
                // This should not happen!
-               debug_report_bug('pool is null.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'pool is null.');
        } // END - if
 
        // Is the pool an array and 'pool' set?
@@ -220,7 +220,7 @@ function FILTER_LOAD_INCLUDES ($pool) {
        // Is it an array?
        if ((!isset($data)) || (!is_array($data))) {
                // Then abort here
-               debug_report_bug(sprintf("INC_POOL is no array! Type: %s", gettype($data)));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("INC_POOL is no array! Type: %s", gettype($data)));
        } elseif (isset($data['inc_pool'])) {
                // Use this as new inclusion pool!
                setIncludePool($realPool, $data['inc_pool']);
@@ -489,7 +489,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
                                $code = call_user_func($commandFunction, $data);
                        } else {
                                // Unsupported command detected
-                               debug_report_bug('Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
+                               debug_report_bug(__FUNCTION__, __LINE__, 'Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
                        }
                } // END - foreach
        } // END - if
@@ -521,7 +521,7 @@ function FILTER_RUN_RESET_INCLUDES () {
        // Is the reset set or old sql_patches?
        if (((!isResetModeEnabled()) || (!isExtensionInstalled('sql_patches'))) && (getOutputMode() == '0')) {
                // Then abort here
-               debug_report_bug('Cannot run reset! enabled='.intval(isResetModeEnabled()).',ext='.intval(isExtensionInstalled('sql_patches')).' Please report this bug. Thanks');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot run reset! enabled='.intval(isResetModeEnabled()).',ext='.intval(isExtensionInstalled('sql_patches')).' Please report this bug. Thanks');
        } // END - if
 
        // Get more daily reset scripts
@@ -885,7 +885,7 @@ function FILTER_FETCH_USER_DATA ($userid = 0) {
        // Get user data
        if (!fetchUserData($userid)) {
                // Userid is not valid
-               debug_report_bug('User id '.$userid . ' is invalid.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'User id '.$userid . ' is invalid.');
        } // END - if
 
        // Set member id
@@ -897,7 +897,7 @@ function FILTER_RESET_USER_LOGIN_FAILURE () {
        // Is the user data valid?
        if (!isMember()) {
                // Do only run for logged in members
-               debug_report_bug('Please only run this filter for logged in users.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
        } // END - if
 
        // Remmeber login failures if available
@@ -911,7 +911,7 @@ SET
 WHERE
        `userid`=%s
 LIMIT 1",
-                       array(getMemberId()), __FILE__, __LINE__);
+                       array(getMemberId()), __FUNCTION__, __LINE__);
 
                // Store it in session
                setSession('mailer_member_failures' , getUserData('login_failures'));
index 9a6014a05b515e9197cc8299bf1b50e8c4e45c5f..305ee3f8aa02f6b18964bd1878aa3fb6aac2c7cb 100644 (file)
@@ -85,7 +85,7 @@ function outputHtml ($htmlCode, $newLine = true) {
 
                        default:
                                // Huh, something goes wrong or maybe you have edited config.php ???
-                               app_die(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}');
+                               debug_report_bug(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}');
                                break;
                } // END - switch
        } elseif ((getPhpCaching() == 'on') && ((!isset($GLOBALS['header'])) || (count($GLOBALS['header']) == 0))) {
@@ -162,7 +162,7 @@ function compileFinalOutput () {
                // Was that eval okay?
                if (empty($newContent)) {
                        // Something went wrong!
-                       debug_report_bug('Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', false);
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', false);
                } // END - if
 
                // Use it again
@@ -256,7 +256,7 @@ function getTotalFatalErrors () {
 // Load a template file and return it's content (only it's name; do not use ' or ")
 function loadTemplate ($template, $return = false, $content = array()) {
        // @TODO Remove this sanity-check if all is fine
-       if (!is_bool($return)) debug_report_bug('return is not bool (' . gettype($return) . ')');
+       if (!is_bool($return)) debug_report_bug(__FUNCTION__, __LINE__, 'return is not bool (' . gettype($return) . ')');
 
        // @TODO Try to rewrite all $DATA to $content
        global $DATA;
@@ -839,7 +839,7 @@ function translateGender ($gender) {
                case 'C': $ret = getMessage('GENDER_C'); break;
                default:
                        // Please report bugs on unknown genders
-                       debug_report_bug(sprintf("Unknown gender %s detected.", $gender));
+                       debug_report_bug(__FUNCTION__, __LINE__, sprintf("Unknown gender %s detected.", $gender));
                        break;
        } // END - switch
 
@@ -864,7 +864,7 @@ function translateUserStatus ($status) {
 
                default:
                        // Please report all unknown status
-                       debug_report_bug(sprintf("Unknown status %s detected.", $status));
+                       debug_report_bug(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status));
                        break;
        } // END - switch
 
@@ -954,7 +954,7 @@ function redirectToUrl ($URL, $allowSpider = true) {
        } // END - if
 
        // Three different ways to debug...
-       //* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
+       //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'URL=' . $URL);
        //* DEBUG: */ die($URL);
 
@@ -993,7 +993,7 @@ function redirectToConfiguredUrl ($configEntry) {
        // Is this URL set?
        if (is_null($URL)) {
                // Then abort here
-               debug_report_bug(sprintf("Configuration entry %s is not set!", $configEntry));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Configuration entry %s is not set!", $configEntry));
        } // END - if
 
        // Load the URL
@@ -1341,7 +1341,7 @@ function bigintval ($num, $castValue = true, $abortOnMismatch = true) {
        // Has the whole value changed?
        if (('' . $ret . '' != '' . $num . '') && ($abortOnMismatch === true)) {
                // Log the values
-               debug_report_bug('Problem with number found. ret=' . $ret . ', num='. $num);
+               debug_report_bug(__FUNCTION__, __LINE__, 'Problem with number found. ret=' . $ret . ', num='. $num);
        } // END - if
 
        // Return result
@@ -1353,7 +1353,7 @@ function generateImageOrCode ($img_code, $headerSent = true) {
        // Is the code size oversized or shouldn't we display it?
        if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == '0')) {
                // Stop execution of function here because of over-sized code length
-               debug_report_bug('img_code ' . $img_code .' has invalid length. img_code()=' . strlen($img_code) . ' code_length=' . getConfig('code_length'));
+               debug_report_bug(__FUNCTION__, __LINE__, 'img_code ' . $img_code .' has invalid length. img_code()=' . strlen($img_code) . ' code_length=' . getConfig('code_length'));
        } elseif ($headerSent === false) {
                // Return an HTML code here
                return '<img src="{%url=img.php?code=' . $img_code . '%}" alt="Image" />';
@@ -2074,7 +2074,7 @@ function isUrlValid ($URL, $compile=true) {
 // Generate a list of administrative links to a given userid
 function generateMemberAdminActionLinks ($userid, $status = '') {
        // Make sure userid is a number
-       if ($userid != bigintval($userid)) debug_report_bug('userid is not a number!');
+       if ($userid != bigintval($userid)) debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
 
        // Define all main targets
        $targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
@@ -2155,7 +2155,7 @@ function generateHash ($plainText, $salt = '', $hash = true) {
        // Do we miss an arry element here?
        if (!isConfigEntrySet('file_hash')) {
                // Stop here
-               debug_report_bug('Missing file_hash in ' . __FUNCTION__ . '.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Missing file_hash in ' . __FUNCTION__ . '.');
        } // END - if
 
        // When the salt is empty build a new one, else use the first x configured characters as the salt
@@ -2377,7 +2377,7 @@ function app_die ($F, $L, $message) {
                loadIncludeOnce('inc/footer.php');
        } else {
                // Script tried to kill itself twice
-               debug_report_bug('Script wanted to kill itself more than once! Raw message=' . $message . ', file/function=' . $F . ', line=' . $L);
+               die('['.__FUNCTION__.':'.__LINE__.']: Script wanted to kill itself more than once! Raw message=' . $message . ', file/function=' . $F . ', line=' . $L);
        }
 }
 
@@ -2526,7 +2526,7 @@ function debug_get_mailable_backtrace () {
 }
 
 // Output a debug backtrace to the user
-function debug_report_bug ($message = '', $sendEmail = true) {
+function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
        // Is this already called?
        if (isset($GLOBALS[__FUNCTION__])) {
                // Other backtrace
@@ -2549,7 +2549,7 @@ function debug_report_bug ($message = '', $sendEmail = true) {
                );
 
                // @TODO Add a little more infos here
-               logDebugMessage(__FUNCTION__, __LINE__, strip_tags($message));
+               logDebugMessage($F, $L, strip_tags($message));
        } // END - if
 
        // Add output
@@ -2571,7 +2571,7 @@ function debug_report_bug ($message = '', $sendEmail = true) {
        } // END - if
 
        // And abort here
-       app_die(__FUNCTION__, __LINE__, $debug);
+       app_die($F, $L, $debug);
 }
 
 // Generates a ***weak*** seed
@@ -2633,7 +2633,7 @@ function getMessageFromErrorCode ($code) {
                case getCode('URL_TLOCK'):
                        // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
                        $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
-                               array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
+                               array(bigintval(getRequestParameter('id'))), __FUNCTION__, __LINE__);
 
                        // Load timestamp from last order
                        list($timestamp) = SQL_FETCHROW($result);
@@ -2855,8 +2855,8 @@ function logDebugMessage ($funcFile, $line, $message, $force=true) {
                // Remove CRLF
                $message = str_replace("\r", '', str_replace("\n", '', $message));
 
-               // Log this message away, we better don't call app_die() here to prevent an endless loop
-               $fp = fopen(getConfig('CACHE_PATH') . 'debug.log', 'a') or die(__FUNCTION__.'['.__LINE__.']: Cannot write logfile debug.log!');
+               // Log this message away
+               $fp = fopen(getConfig('CACHE_PATH') . 'debug.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write logfile debug.log!');
                fwrite($fp, date('d.m.Y|H:i:s', time()) . '|' . getModule(false) . '|' . basename($funcFile) . '|' . $line . '|' . $message . "\n");
                fclose($fp);
        } // END - if
@@ -3150,10 +3150,10 @@ function shutdown () {
        // Check if not in installation phase and the link is up
        if ((!isInstallationPhase()) && (SQL_IS_LINK_UP())) {
                // Close link
-               SQL_CLOSE(__FILE__, __LINE__);
+               SQL_CLOSE(__FUNCTION__, __LINE__);
        } elseif (!isInstallationPhase()) {
                // No database link
-               addFatalMessage(__FILE__, __LINE__, getMessage('NO_DB_LINK_SHUTDOWN'));
+               addFatalMessage(__FUNCTION__, __LINE__, getMessage('NO_DB_LINK_SHUTDOWN'));
        }
 
        // Stop executing here
@@ -3168,7 +3168,7 @@ function initMemberId () {
 // Setter for member id
 function setMemberId ($memberid) {
        // We should not set member id to zero
-       if ($memberid == '0') debug_report_bug('Userid should not be set zero.');
+       if ($memberid == '0') debug_report_bug(__FUNCTION__, __LINE__, 'Userid should not be set zero.');
 
        // Set it secured
        $GLOBALS['member_id'] = bigintval($memberid);
@@ -3221,7 +3221,7 @@ function getExtraTitle () {
        // Is the extra title set?
        if (!isExtraTitleSet()) {
                // No, then abort here
-               debug_report_bug('extra_title is not set!');
+               debug_report_bug(__FUNCTION__, __LINE__, 'extra_title is not set!');
        } // END - if
 
        // Return it
@@ -3316,7 +3316,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
        $files = array();
 
        // Open directory
-       $dirPointer = opendir(getConfig('PATH') . $baseDir) or app_die(__FUNCTION__, __LINE__, 'Cannot read directory ' . basename($baseDir) . '.');
+       $dirPointer = opendir(getConfig('PATH') . $baseDir) or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot read directory ' . basename($baseDir) . '.');
 
        // Read all entries
        while ($baseFile = readdir($dirPointer)) {
@@ -3390,7 +3390,7 @@ function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = false, $ad
                                }
                        } else {
                                // We found .php file but should not search for them, why?
-                               debug_report_bug('We should find files with extension=' . $extension . ', but we found a PHP script.');
+                               debug_report_bug(__FUNCTION__, __LINE__, 'We should find files with extension=' . $extension . ', but we found a PHP script.');
                        }
                } elseif (substr($baseFile, -4, 4) == $extension) {
                        // Other, generic file found
@@ -3469,7 +3469,7 @@ function initCacheInstance () {
        $GLOBALS['cache_instance'] = new CacheSystem();
        if ($GLOBALS['cache_instance']->getStatus() != 'done') {
                // Failed to initialize cache sustem
-               addFatalMessage(__FILE__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMessage('CACHE_CANNOT_INITIALIZE'));
+               addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMessage('CACHE_CANNOT_INITIALIZE'));
        } // END - if
 }
 
@@ -3564,7 +3564,7 @@ function determinePageTitle () {
                $pageTitle = getMessage('NO_CONFIG_FOUND_TITLE');
 
                // Do not add the fatal message in installation mode
-               if ((!isInstalling()) && (!isConfigurationLoaded())) addFatalMessage(__FILE__, __LINE__, getMessage('NO_CONFIG_FOUND'));
+               if ((!isInstalling()) && (!isConfigurationLoaded())) addFatalMessage(__FUNCTION__, __LINE__, getMessage('NO_CONFIG_FOUND'));
        }
 
        // Return title
@@ -3800,7 +3800,7 @@ function getModuleFromFileName ($file, $accessLevel) {
                        break;
 
                default: // Unsupported file name / access level
-                       debug_report_bug('Unsupported file name=' . basename($file) . '/access level=' . $accessLevel);
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported file name=' . basename($file) . '/access level=' . $accessLevel);
                        break;
        }
 
index e4c5f9781114054420c38d8fb3ab812534d64a5b..74eb58753db0a3e35ddbf41d591776fd0ef98c18 100644 (file)
@@ -53,7 +53,7 @@ function __errorHandler ($errno, $errstr, $errfile, $errline) {
        );
 
        // Output message to user and die
-       debug_report_bug($message);
+       debug_report_bug($errfile, $errline, $message);
 }
 
 // Init error handler
index d93731ab0dbc14ee3cc4eac0a4cfa70eb95bdd4e..989eb238d4fb910d572ab93a4b0c8eb02f77420a 100644 (file)
@@ -123,7 +123,7 @@ function loadInclude ($inc) {
                // Is the include file there?
                if (!isIncludeReadable($inc)) {
                        // Not there so log it
-                       debug_report_bug(sprintf("Include file %s not found.", $inc));
+                       debug_report_bug(__FUNCTION__, __LINE__, sprintf("Include file %s not found.", $inc));
                } // END - if
        } // END - if
 
index f27ccb8c024bd35f0c9364f7559e44d96033fbfc..1f70d3aa550c524d7e69bad93157f918e42a65e8 100644 (file)
@@ -226,7 +226,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                                        mergeSqls(explode(";\n", $fileContent), 'install');
                                                                } else {
                                                                        // Not readable!
-                                                                       debug_report_bug(sprintf("SQL dump %s is not readable!", $dump));
+                                                                       debug_report_bug(__FILE__, __LINE__, sprintf("SQL dump %s is not readable!", $dump));
                                                                }
                                                        } // END - foreach
                                                        //* DEBUG: */ die(__FUNCTION__.'['.__LINE__.']:'<pre>'.print_r(getSqls(), true).'</pre>');
index 8bca848b23df1734b35837a63ac806ac2d015035..b613105fa409c312379ffcf39ec120d603cdec30 100644 (file)
@@ -166,7 +166,7 @@ function adminsChangeAdminAccount ($postData, $element = '') {
                if ((!empty($element)) && (isset($postData[$element]))) {
                        // Save this setting
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `%s`='%s' WHERE `id`=%s LIMIT 1",
-                               array($element, $postData[$element][$id], $id), __FILE__, __LINE__);
+                               array($element, $postData[$element][$id], $id), __FUNCTION__, __LINE__);
 
                        // Admin account saved
                        $message = getMessage('ADMIN_ACCOUNT_SAVED');
@@ -561,7 +561,7 @@ function getAminsExpertWarning () {
 function getAdminLoginFailures ($adminLogin) {
        // Admin login should not be empty
        if (empty($adminLogin)) {
-               debug_report_bug('adminLogin is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'adminLogin is empty.');
        } // END - if
 
        // By default no admin is found
@@ -597,7 +597,7 @@ function getAdminLoginFailures ($adminLogin) {
 function getAdminLastFailure ($adminLogin) {
        // Admin login should not be empty
        if (empty($adminLogin)) {
-               debug_report_bug('adminLogin is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'adminLogin is empty.');
        } // END - if
 
        // By default no admin is found
index 21ef2d6d1b2dcbefc3e2aa155f0a8498496dcc7c..5c99bb2e47dae5cfc4a58541cdc0a55591f6ecfd 100644 (file)
@@ -291,7 +291,7 @@ function FILTER_ADD_LOGIN_BONUS () {
        // Is the user data valid?
        if (!isMember()) {
                // Do only run for logged in members
-               debug_report_bug('Please only run this filter for logged in users.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
        } // END - if
 
        // Bonus is not given by default ;-)
@@ -309,7 +309,7 @@ WHERE
 LIMIT 1",
                        array(
                                getMemberId()
-                       ), __FILE__, __LINE__
+                       ), __FUNCTION__, __LINE__
                );
 
                // Updated entry?
index 11ca2ba09d9984c2cb994c9557d783326e606faf..be9110404ba4f638118c66249b94da157c1b1830 100644 (file)
@@ -86,7 +86,7 @@ function doAdminNetworkProcessForm () {
        // Is the function valid?
        if (!function_exists($functionName)) {
                // Invalid function name
-               debug_report_bug('Invalid do ' . getRequestParameter('do') . ', function ' . $functionName .' does not exist.', false);
+               debug_report_bug(__FUNCTION__, __LINE__, 'Invalid do ' . getRequestParameter('do') . ', function ' . $functionName .' does not exist.', false);
        } // END - if
 
        // Call-back the method handling our request
@@ -146,7 +146,7 @@ function getNetworkDataById ($id, $column = '') {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // Set current network id
@@ -192,7 +192,7 @@ function getNetworkDataByTypeId ($id, $column = '') {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network type id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network type id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // Set current network id
@@ -243,7 +243,7 @@ function getNetworkTypeDataById ($id) {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network type id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network type id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // By default we have no data
@@ -277,7 +277,7 @@ function getNetworkRequestParamsDataById ($id) {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network request parameter id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // By default we have no data
@@ -311,7 +311,7 @@ function doNetworkUpdateDataByArray ($id, $networkData) {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // Just call our inner method
@@ -323,7 +323,7 @@ function doNetworkUpdateTypeByArray ($id, $networkTypeData) {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network type handler id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network type handler id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // Just call our inner method
@@ -335,7 +335,7 @@ function doNetworkUpdateParamsByArray ($id, $networkParamData) {
        // Ids lower one are not accepted
        if ($id < 1) {
                // Not good, should be fixed
-               debug_report_bug('Network request parameter id ' . $id . ' is smaller than 1.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Network request parameter id ' . $id . ' is smaller than 1.');
        } // END - if
 
        // Just call our inner method
@@ -346,7 +346,7 @@ function doNetworkUpdateParamsByArray ($id, $networkParamData) {
 function doAdminRemoveNetworkEntry ($table, $column, $id, $limit = 1) {
        // Remove the entry
        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_network_%s` WHERE `%s`=%s LIMIT %s",
-               array($table, $column, $id, $limit), __FILE__, __LINE__);
+               array($table, $column, $id, $limit), __FUNCTION__, __LINE__);
 
        // Return affected rows
        return SQL_AFFECTEDROWS();
@@ -363,7 +363,7 @@ function generateAdminNetworkList () {
 FROM
        `{?_MYSQL_PREFIX?}_network_data`
 ORDER BY
-       `network_short_name` ASC", __FILE__, __LINE__);
+       `network_short_name` ASC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
@@ -407,7 +407,7 @@ ORDER BY
        `network_type_handle` ASC",
                array(
                        bigintval($networkId)
-               ), __FILE__, __LINE__);
+               ), __FUNCTION__, __LINE__);
 
        // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
@@ -451,7 +451,7 @@ ON
        t.`network_id`=d.`network_id`
 ORDER BY
        d.`network_short_name` ASC,
-       t.`network_type_handle` ASC", __FILE__, __LINE__);
+       t.`network_type_handle` ASC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
@@ -657,7 +657,7 @@ function doAdminNetworkProcessHandlenetworkForm () {
                                                $OUT .= loadTemplate('admin_del_networks_row', true, $networkData);
                                        } else {
                                                // Problem!
-                                               debug_report_bug('Cannot detect edit/del.');
+                                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
 
                                        // Switch colors
@@ -675,7 +675,7 @@ function doAdminNetworkProcessHandlenetworkForm () {
                                loadTemplate('admin_del_networks', false, $OUT);
                        } else {
                                // Problem!
-                               debug_report_bug('Cannot detect edit/del.');
+                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                        }
 
                        // Don't display the list/add new form
@@ -718,7 +718,7 @@ function doAdminNetworkProcessHandlenetworktypeForm () {
                                                $OUT .= loadTemplate('admin_del_network_types_row', true, $networkTypeData);
                                        } else {
                                                // Problem!
-                                               debug_report_bug('Cannot detect edit/del.');
+                                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
 
                                        // Switch colors
@@ -742,7 +742,7 @@ function doAdminNetworkProcessHandlenetworktypeForm () {
                                loadTemplate('admin_del_network_types', false, $content);
                        } else {
                                // Problem!
-                               debug_report_bug('Cannot detect edit/del.');
+                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                        }
 
                        // Don't display the list/add new form
@@ -797,7 +797,7 @@ function doAdminNetworkProcessHandlerequestparamsForm () {
                                                $OUT .= loadTemplate('admin_del_network_params_row', true, $networkRequestData);
                                        } else {
                                                // Problem!
-                                               debug_report_bug('Cannot detect edit/del.');
+                                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
 
                                        // Switch colors
@@ -821,7 +821,7 @@ function doAdminNetworkProcessHandlerequestparamsForm () {
                                loadTemplate('admin_del_network_params', false, $content);
                        } else {
                                // Problem!
-                               debug_report_bug('Cannot detect edit/del.');
+                               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                        }
 
                        // Don't display the list/add new form
@@ -855,7 +855,7 @@ function doAdminNetworkProcessChangenetworkForm () {
                                        // Do we have this enty?
                                        if (!isset($entry[$id])) {
                                                // Not found, needs fixing
-                                               debug_report_bug('No entry in key=' . $key . ', id=' . $id . ' found.');
+                                               debug_report_bug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $id . ' found.');
                                        } // END - if
 
                                        // Add this entry
@@ -969,7 +969,7 @@ function doAdminNetworkProcessChangenetworktypeForm () {
                                        // Do we have this enty?
                                        if (!isset($entry[$id])) {
                                                // Not found, needs fixing
-                                               debug_report_bug('No entry in key=' . $key . ', id=' . $id . ' found.');
+                                               debug_report_bug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $id . ' found.');
                                        } // END - if
 
                                        // Fix empty network_type_banner_url to NULL
@@ -1020,7 +1020,7 @@ function doAdminNetworkProcessChangenetworkparamForm () {
                                        // Do we have this enty?
                                        if (!isset($entry[$id])) {
                                                // Not found, needs fixing
-                                               debug_report_bug('No entry in key=' . $key . ', id=' . $id . ' found.');
+                                               debug_report_bug(__FUNCTION__, __LINE__, 'No entry in key=' . $key . ', id=' . $id . ' found.');
                                        } // END - if
 
                                        // Fix empty request_param_default to NULL
index 91c84f1158bb5984491dad8c3f0accc290acd9b6..3e2cf9d02fa6137b79a5757a14abd82c8886ced7 100644 (file)
@@ -50,7 +50,7 @@ function FILTER_UPDATE_ONLINE_LIST () {
        // Empty session?
        if (session_id() == '') {
                // This is invalid here!
-               debug_report_bug('Invalid session.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Invalid session.');
        } // END - if
 
        // Initialize variables
index d4db9cc067579c853e3c018a0cdc4180fcffd490..9218d5e93dcf422b14e147c7c123f29a95ae1063 100644 (file)
@@ -357,7 +357,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
                bigintval(postRequestParameter('refid')),
                $hash,
                detectRemoteAddr(),
-       ), __FILE__, __LINE__);
+       ), __FUNCTION__, __LINE__);
 
        // Get his userid
        $userid = bigintval(SQL_INSERTID());
@@ -382,7 +382,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
        // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
-               array($userid), __FILE__, __LINE__);
+               array($userid), __FUNCTION__, __LINE__);
        if (SQL_HASZERONUMS($result)) {
                // Add only when the line was not found (maybe some more secure?)
                $locked = 'points';
@@ -391,7 +391,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
                if (getConfig('ref_payout') > 0) $locked = 'locked_points';
 
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,0,'{?points_register?}')",
-                       array($locked, $userid), __FILE__, __LINE__);
+                       array($locked, $userid), __FUNCTION__, __LINE__);
 
                // Update mediadata as well
                if ((isExtensionInstalledAndNewer('mediadata', '0.0.4')) && ($locked == 'points')) {
@@ -406,7 +406,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
                        if ($joined == 'Y') {
                                // Insert category entry
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (`userid`, `cat_id`) VALUES (%s, %s)",
-                                       array($userid, bigintval($cat)), __FILE__, __LINE__);
+                                       array($userid, bigintval($cat)), __FUNCTION__, __LINE__);
                        } // END - if
                } // END - foreach
        } // END - if
index 6716188e18beb2db07f90446beb5c3292fd587a1..2260039884b7d13acea6878d27bb9bfd2911fb5d 100644 (file)
@@ -1752,7 +1752,7 @@ function SURFBAR_GET_DATA ($element) {
                print('<pre>');
                print_r($GLOBALS['surfbar_cache']);
                print('</pre>');
-               debug_report_bug('Element ' . $element . ' not found.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Element ' . $element . ' not found.');
        }
 
        // Return result
index c733441a6afdd10f7f09f190da1f632f3c878645..2279e5741fdfb5adf53b55b50b095872f7bb9b80 100644 (file)
@@ -72,7 +72,7 @@ FROM
        `{?_MYSQL_PREFIX?}_themes`
 ".$add."
 ORDER BY
-       `theme_name` ASC", __FILE__, __LINE__);
+       `theme_name` ASC", __FUNCTION__, __LINE__);
 
        // Load all themes
        while ($content = SQL_FETCHARRAY($result)) {
@@ -331,7 +331,7 @@ function FILTER_SET_USERS_THEME () {
        // Is the user data valid?
        if (!isMember()) {
                // Do only run for logged in members
-               debug_report_bug('Please only run this filter for logged in users.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Please only run this filter for logged in users.');
        } // END - if
 
        // Change to new theme
index ab92eba1d2f2ff54cb2e28f4e38e02e311fb677b..83167b12750858a146374a249d2e7931f47c2be4 100644 (file)
@@ -335,7 +335,7 @@ function translateYooMediaError ($errorCode) {
                $return = $GLOBALS['translation_tables']['yoomedia']['error_codes'][$errorCode];
        } else {
                // Log missing entries
-               debug_report_bug(sprintf("Unknown error code <strong>%s[%s]</strong> detected.", $errorCode, gettype($errorCode)));
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Unknown error code <strong>%s[%s]</strong> detected.", $errorCode, gettype($errorCode)));
        }
 
        // Return value
@@ -434,7 +434,7 @@ function YOOMEDIA_GET_ERRORCODE_FROM_RESULT ($response) {
 
        } else {
                // Should not happen!
-               debug_report_bug('Cannot parse response. Raw response:<pre>' . print_r($response, true) . '</pre>');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot parse response. Raw response:<pre>' . print_r($response, true) . '</pre>');
        }
 
        // Fix empty code to bad
index fbda547f94aa216c765b05db663ee9752a92158f..fce7ca86967a46abc9bd8818c3728bcda1f78e88 100644 (file)
@@ -62,7 +62,7 @@ if ((isIncludeReadable(getConfig('CACHE_PATH') . 'config-local.php')) && (isIncl
        setConfigEntry('OUTPUT_MODE', 'render');
 
        // Both exist! This is bad and should be avoided by the admin
-       app_die(__FILE__, __LINE__, 'You have uploaded or kept an out-dated file at <strong>inc/config.php</strong> along with the new file <strong>'.getConfig('CACHE_PATH').'config-local.php</strong>. Please remove <strong>inc/config.php</strong> to avoid incompatiblity issues. Thank you.');
+       debug_report_bug(__FILE__, __LINE__, 'You have uploaded or kept an out-dated file at <strong>inc/config.php</strong> along with the new file <strong>'.getConfig('CACHE_PATH').'config-local.php</strong>. Please remove <strong>inc/config.php</strong> to avoid incompatiblity issues. Thank you.');
 } elseif (isIncludeReadable(getConfig('CACHE_PATH') . 'config-local.php')) {
        // Then load it
        loadIncludeOnce(getConfig('CACHE_PATH') . 'config-local.php');
@@ -89,10 +89,10 @@ if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!isInstallation
        outputHtml('<strong>{--MAILER_WARNING--}:</strong>');
        if (isInstalled()) {
                // You have changed my configuration file!
-               app_die(__FILE__, __LINE__, '{--DIE_CONFIG_CHANGED_YOU--}');
+               debug_report_bug(__FILE__, __LINE__, '{--DIE_CONFIG_CHANGED_YOU--}');
        } else {
                // Please run the installation script (maybe again)
-               app_die(__FILE__, __LINE__, '{--DIE_RUN_INSTALL_MYSQL--}');
+               debug_report_bug(__FILE__, __LINE__, '{--DIE_RUN_INSTALL_MYSQL--}');
        }
 } elseif ((!isInstalling()) && (!isInstallationPhase()) && (empty($GLOBALS['mysql']['password'])) && (getConfig('WARN_NO_PASS') == 'Y')) {
        // No database password entered!!!
index 4875790656a818ecccab8dba563d46125b53159b..be0d09f63090ae18b92944d31600789e1818f04f 100644 (file)
@@ -56,7 +56,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i
        // Do only process valid arrays
        if (!isset($modArray['module'])) {
                // We should fix this!
-               debug_report_bug('modArray=<pre>'.print_r($modArray, true).'</pre>');
+               debug_report_bug(__FILE__, __LINE__, 'modArray=<pre>'.print_r($modArray, true).'</pre>');
        } // END - if
 
        // Rewrite some parts
index 2f9bd54d5a8c13873776e11da90e8e2969791d1e..e63b021236d942ab9de98650db49aae2e365fe85 100644 (file)
@@ -861,7 +861,7 @@ function adminBuilderStatusHandler ($mode, $IDs, $table, $columns, $filterFuncti
                                        } // END - if
                                } elseif (isset($content[$column])) {
                                        // Unfinished!
-                                       app_die(__FUNCTION__, __LINE__, ":UNFINISHED: id={$id}/{$column}[".gettype($statusInfo)."] = {$content[$column]}");
+                                       debug_report_bug(__FUNCTION__, __LINE__, ":UNFINISHED: id={$id}/{$column}[".gettype($statusInfo)."] = {$content[$column]}");
                                }
                        } // END - foreach
 
@@ -1201,7 +1201,7 @@ function adminUpdateTaskData ($id, $row, $data) {
        // Is the id not set, then we need a backtrace here... :(
        if ($id <= 0) {
                // Initiate backtrace
-               debug_report_bug(sprintf("id is invalid: %s. row=%s, data=%s",
+               debug_report_bug(__FUNCTION__, __LINE__, sprintf("id is invalid: %s. row=%s, data=%s",
                        $id,
                        $row,
                        $data
index 360550d5b99886530e149de939748d34365379d1..9685c51acd8fcd397bf704e8c14b0b11401dc59c 100644 (file)
@@ -261,7 +261,7 @@ LIMIT 1",
                                        $taskData['text'] .= getExtensionNotes();
                                } else {
                                        // This should not normally happen!
-                                       debug_report_bug('ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! sql_patches=' . getExtensionVersion('sql_patches') . '/verbose_sql=' . getConfig('verbose_sql'));
+                                       debug_report_bug(__FILE__, __LINE__, 'ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! sql_patches=' . getExtensionVersion('sql_patches') . '/verbose_sql=' . getConfig('verbose_sql'));
                                }
 
                                // Prepare array for the template
@@ -421,7 +421,7 @@ LIMIT 1",
                                }
                        } else {
                                // Unknown action
-                               debug_report_bug(sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, true)));
+                               debug_report_bug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, true)));
                        }
 
                        // Update query
index a0f9287d5781efc34174be023a79532b786d76f8..cf56d8a3d330e801298952d3d426ba1257b869bb 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if (isFormSent()) {
        // @TODO Check if category does already exist
-       debug_report_bug('Unfinished area!');
+       debug_report_bug(__FILE__, __LINE__, 'Unfinished area!');
 } else {
        // Display form
        loadTemplate('admin_add_guestnl_cat');
index 8d6a01fba22500cedfb83ca2acb9c019278a345a..9a2541368f0884aa49b4d273e7f943e4c9d0d2c5 100644 (file)
@@ -72,7 +72,7 @@ if (isGetRequestParameterSet(('pid'))) {
                // Load user's data
                if (!fetchUserData($userid)) {
                        // Abort here because it is not valid!
-                       debug_report_bug('No user account ' . $userid . ' found.');
+                       debug_report_bug(__FILE__, __LINE__, 'No user account ' . $userid . ' found.');
                } // END - if
 
                if ((getRequestParameter('do') == 'accept') && (!empty(getUserData('email')))) {
index 5d5a3cd5476f4611fcb79619e7863f47a6e8d2b8..206b4777e53303f51e0995b4b24fd3354a6742e3 100644 (file)
@@ -126,7 +126,7 @@ ORDER BY
                                } // END - foreach
                        } else {
                                // Unknown action performed
-                               debug_report_bug(sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), true)));
+                               debug_report_bug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), true)));
                        }
 
                        // Update query
index 75bf5075bf663349b55a44ff4d22255310c06875..166f2b8a5bc842b2d81abcb1bcf807d942a9e118 100644 (file)
@@ -65,7 +65,7 @@ if (isGetRequestParameterSet('hash')) {
                // Fetch user data
                if (!fetchUserData($userid)) {
                        // Not found, should not happen
-                       debug_report_bug('User account ' . $userid . ' not found.');
+                       debug_report_bug(__FILE__, __LINE__, 'User account ' . $userid . ' not found.');
                } // END - if
 
                // Load all data and add points
index 9fe4fc71489b362f38557eedd9b30b375f2dcbc9..aadc78d97698350bbaf8002123db0b4910a68fc3 100644 (file)
@@ -66,7 +66,7 @@ switch (getRequestParameter('mode')) {
 
        default:
                // Unsupported mode
-               debug_report_bug(sprintf("Unsupported mode <span class=\"data\">%s</span> detected.", secureString(getRequestParameter('mode'))));
+               debug_report_bug(__FILE__, __LINE__, sprintf("Unsupported mode <span class=\"data\">%s</span> detected.", secureString(getRequestParameter('mode'))));
                break;
 }
 
index 2f4528168c6822adf1e3c3e3a46032933154f5c1..c74bf46c3c002136db1c27d6aa9008a0e244306d 100644 (file)
@@ -631,7 +631,7 @@ function fetchUserData ($userid, $column = 'userid') {
                // Don't look for invalid userids...
                if ($userid < 1) {
                        // Invalid, so abort here
-                       debug_report_bug('User id ' . $userid . ' is invalid.');
+                       debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $userid . ' is invalid.');
                } elseif (isUserDataValid()) {
                        // Use cache, so it is fine
                        return true;
@@ -796,7 +796,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
                $OUT = loadTemplate(($mode . '_receive_table'), true, $OUT);
        } else {
                // Maybe the admin has to setup some maximum values?
-               debug_report_bug('Nothing is being done here?');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Nothing is being done here?');
        }
 
        // Free result
@@ -1562,7 +1562,7 @@ function generateOptionList ($table, $id, $name, $default='', $special='', $wher
                        } // END - foreach
                } else {
                        // Problem in request
-                       debug_report_bug('Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name));
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name));
                }
        } else {
                // Data from database
index 0058a5bb338b3876743e2433341c02b7df8d1a1d..2b4b74702ae21d9a8d68f0f49b271eaeb8e1e0f3 100644 (file)
@@ -212,7 +212,7 @@ function getArrayFromActualVersion () {
                // Invalid request reply?
                if (!isset($version[11])) {
                        // Cannot continue here
-                       debug_report_bug('Invalid response from check-updates3.php, count should be 10+, is ' . count($version));
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Invalid response from check-updates3.php, count should be 10+, is ' . count($version));
                } // END - if
 
                // Prepare content
index 12838b3b3392d8bab258b01df89c1a38bad66e1f..ebe08b6e9b21d726af8adc94564816a539bab101 100644 (file)
@@ -78,7 +78,7 @@ if ((getOutputMode() == 1) || (getConfig('css_php') == 'DIRECT')) {
                                        break;
 
                                default: // Invalid mode!
-                                       debug_report_bug(sprintf("Invalid css_php value %s detected.", getConfig('css_php')));
+                                       debug_report_bug(__FILE__, __LINE__, sprintf("Invalid css_php value %s detected.", getConfig('css_php')));
                                        break;
                        } // END - switch
                } // END - if
index 6e8cb2e97b73f771c1c6fe6ef535a81d11b53984..dbd6e713f4c0173f6106b82e8dc2edd9852ded04 100644 (file)
@@ -92,7 +92,7 @@ function writeToFile ($FQFN, $content, $aquireLock = false) {
                }
        } else {
                // Write it with fopen
-               $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN).'!');
+               $fp = fopen($FQFN, 'w') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($FQFN) . '!');
 
                // Aquire lock
                if ($aquireLock === true) flock($fp, LOCK_EX);
@@ -154,10 +154,10 @@ function merge_array ($array1, $array2) {
                debug_report_bug(__FUNCTION__ . ': No arrays provided!');
        } elseif (!is_array($array1)) {
                // Left one is not an array
-               debug_report_bug(sprintf("[%s:%s] array1 is not an array. array != %s", __FUNCTION__, __LINE__, gettype($array1)));
+               debug_report_bug(__FILE__, __LINE__, sprintf("array1 is not an array. array != %s", gettype($array1)));
        } elseif (!is_array($array2)) {
                // Right one is not an array
-               debug_report_bug(sprintf("[%s:%s] array2 is not an array. array != %s", __FUNCTION__, __LINE__, gettype($array2)));
+               debug_report_bug(__FILE__, __LINE__, sprintf("array2 is not an array. array != %s", gettype($array2)));
        }
 
        // Merge all together
@@ -393,19 +393,19 @@ function copyFileVerified ($source, $dest, $chmod = '') {
        // Is the source file there?
        if (!isFileReadable($source)) {
                // Then abort here
-               debug_report_bug('Cannot read from source file ' . basename($source) . '.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot read from source file ' . basename($source) . '.');
        } // END - if
 
        // Is the target directory there?
        if (!isDirectory(dirname($dest))) {
                // Then abort here
-               debug_report_bug('Cannot find directory ' . str_replace(getConfig('PATH'), '', dirname($dest)) . '.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot find directory ' . str_replace(getConfig('PATH'), '', dirname($dest)) . '.');
        } // END - if
 
        // Now try to copy it
        if (!copy($source, $dest)) {
                // Something went wrong
-               debug_report_bug('copy() has failed to copy the file.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'copy() has failed to copy the file.');
        } else {
                // Reset cache
                $GLOBALS['file_readable'][$dest] = true;
@@ -437,7 +437,7 @@ function flushHeaders () {
        // Is the header already sent?
        if (headers_sent()) {
                // Then abort here
-               debug_report_bug('Headers already sent!');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Headers already sent!');
        } // END - if
 
        // Flush all headers if found
@@ -457,7 +457,7 @@ function changeMode ($FQFN, $mode) {
        // Is the file/directory there?
        if ((!isFileReadable($FQFN)) && (!isDirectory($FQFN))) {
                // Neither, so abort here
-               debug_report_bug('Cannot chmod() on ' . basename($FQFN) . '.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Cannot chmod() on ' . basename($FQFN) . '.');
        } // END - if
 
        // Try to set them
@@ -555,7 +555,7 @@ function isWhatSet ($strict =  false) {
        // Should we abort here?
        if (($strict === true) && ($isset === false)) {
                // Output backtrace
-               debug_report_bug('what is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'what is empty.');
        } // END - if
 
        // Return it
@@ -590,7 +590,7 @@ function isActionSet ($strict =  false) {
        // Should we abort here?
        if (($strict === true) && ($isset === false)) {
                // Output backtrace
-               debug_report_bug('action is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'action is empty.');
        } // END - if
 
        // Return it
@@ -626,7 +626,7 @@ function isModuleSet ($strict =  false) {
        // Should we abort here?
        if (($strict === true) && ($isset === false)) {
                // Output backtrace
-               debug_report_bug('module is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'module is empty.');
        } // END - if
 
        // Return it
@@ -661,7 +661,7 @@ function isOutputModeSet ($strict =  false) {
        // Should we abort here?
        if (($strict === true) && ($isset === false)) {
                // Output backtrace
-               debug_report_bug('output_mode is empty.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'output_mode is empty.');
        } // END - if
 
        // Return it
@@ -807,7 +807,7 @@ function isAdminHashSet ($admin) {
         * 14.:js.php:57, require(1)
         */
        if (!isset($GLOBALS['cache_array']['admin'])) {
-               debug_report_bug('Cache not set.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Cache not set.');
        } // END - if
 
        // Check for admin hash
@@ -885,7 +885,7 @@ function getCurrentUserId () {
        // Userid must be set before it can be used
        if (!isCurrentUserIdSet()) {
                // Not set
-               debug_report_bug('User id is not set.');
+               debug_report_bug(__FUNCTION__, __LINE__, 'User id is not set.');
        } // END - if
 
        // Return the userid
index 06acf208cad76b145324cd45ff910610bf197afa..79e308753b2878e4dc8770fc1d55520bb6eead6b 100644 (file)
@@ -110,7 +110,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                break;
 
                        default: // Invalid mail type
-                               debug_report_bug('Invalid mail type ' . $ltype . ' detected.');
+                               debug_report_bug(__FILE__, __LINE__, 'Invalid mail type ' . $ltype . ' detected.');
                                break;
                } // END - switch
 
@@ -162,7 +162,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                        break;
 
                                                default: // Invalid mail type
-                                                       debug_report_bug('Invalid mail type ' . $ltype . ' detected.');
+                                                       debug_report_bug(__FILE__, __LINE__, 'Invalid mail type ' . $ltype . ' detected.');
                                                        break;
                                        }
 
index 29a08b5f24b4a4a7bcbc0dd8f7fedab7bf4e7274..ec0417eafcc66f0da42d785d8720d0f1937f884e 100644 (file)
@@ -110,7 +110,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                break;
 
                        default: // Unknown type
-                               debug_report_bug('Unknown mail type ' . $ltype . ' detected.');
+                               debug_report_bug(__FILE__, __LINE__, 'Unknown mail type ' . $ltype . ' detected.');
                                break;
                }
 
@@ -166,7 +166,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                        break;
 
                                                default: // Unknown type
-                                                       debug_report_bug('Unknown mail type ' . $ltype . ' detected.');
+                                                       debug_report_bug(__FILE__, __LINE__, 'Unknown mail type ' . $ltype . ' detected.');
                                                        break;
                                        }
 
@@ -214,7 +214,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                                                        break;
 
                                                                                default: // Unknown type
-                                                                                       debug_report_bug('Unknown mail type ' . $ltype . ' detected.');
+                                                                                       debug_report_bug(__FILE__, __LINE__, 'Unknown mail type ' . $ltype . ' detected.');
                                                                                        break;
                                                                        } // END - switch
 
@@ -328,7 +328,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                                                loadTemplate($templ, false, $content);
                                                                        } else {
                                                                                // Cannot confirm!
-                                                                               debug_report_bug('No code given.');
+                                                                               debug_report_bug(__FILE__, __LINE__, 'No code given.');
                                                                        }
                                                                        break;
 
@@ -348,7 +348,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
                                                                        break;
 
                                                                default: // Unknown mode
-                                                                       debug_report_bug('Unknown mode ' . $mode . ' detected.');
+                                                                       debug_report_bug(__FILE__, __LINE__, 'Unknown mode ' . $mode . ' detected.');
                                                                        break;
                                                        } // END - switch
                                                } else {