/** * Handles error messages * * @param int $type The error code * @param string $message A string describing the error * @param string $file The filename in which the error occurred * @param int $line The line number on which the error occurred * @author Jason Warner <*****@*****.**> * @since Beta 2.0 * @return void **/ function error($type, $message, $file = null, $line = 0) { global $set; // Get the settings! if (isset($_GET['debug']) || function_exists('error_fatal') || !(error_reporting() & $type)) { return; } include $set['include_path'] . '/lib/error.php'; switch ($type) { // Triggered Quicksilver Forums errors case QUICKSILVER_ERROR: exit(error_warning($message, $file, $line)); break; // Triggered Quicksilver Forums notices and alerts // Triggered Quicksilver Forums notices and alerts case QUICKSILVER_NOTICE: exit(error_notice($message)); break; // Database errors // Database errors case QUICKSILVER_QUERY_ERROR: exit(error_fatal($type, $message, $file, $line)); break; // PHP errors // PHP errors default: exit(error_fatal($type, $message, $file, $line)); break; } }
/** * Handles error messages * * @param int $type The error code * @param string $message A string describing the error * @param string $file The filename in which the error occurred * @param int $line The line number on which the error occurred * @author Jason Warner <*****@*****.**> * @since Beta 2.0 * @return void **/ function error($type, $message, $file = null, $line = 0) { if (isset($_GET['debug']) || function_exists('error_fatal') || !(error_reporting() & $type)) { return; } $include = './lib/error.php'; if (!file_exists($include)) { $include = '.' . $include; // Admin Center errors } include $include; switch ($type) { // Triggered Quicksilver Forums errors case QUICKSILVER_ERROR: exit(error_warning($message, $file, $line)); break; // Triggered Quicksilver Forums notices and alerts // Triggered Quicksilver Forums notices and alerts case QUICKSILVER_NOTICE: exit(error_notice($message)); break; // Database errors // Database errors case QUICKSILVER_QUERY_ERROR: exit(error_fatal($type, $message, $file, $line)); break; // PHP errors // PHP errors default: exit(error_fatal($type, $message, $file, $line)); break; } }
$dev = false; } if ($dev) { ini_set('display_errors', 'On'); if (array_key_exists("HTTP_HOST", $_SERVER)) { ini_set('html_errors', 'On'); } else { ini_set('html_errors', 'Off'); } ini_set('docref_root', 'http://au.php.net/manual/en/'); error_reporting(E_ALL ^ (E_STRICT | E_NOTICE)); error_fatal(E_ALL ^ (E_STRICT | E_NOTICE)); set_error_handler('my_error_handler'); } else { error_reporting(E_ALL & ~(E_STRICT | E_NOTICE)); error_fatal(E_ALL & ~(E_STRICT | E_NOTICE)); ini_set('display_errors', 'Off'); set_error_handler('my_error_handler'); } $_ENV["local"] = getcwd() . "/phplib/"; if (!file_exists($_ENV["libdir"] = "/usr/share/phplib/")) { $_ENV["libdir"] = $_ENV["local"]; } $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $_page_start_time = $time; if (array_key_exists("widemode", $_REQUEST)) { $GLOBALS["widemode"] = $_REQUEST["widemode"]; } get_request_values("id,cmd,submit,rowcount,sortorder,sortdesc,startingwith,start,prev,next,last,cond,EditMode,WithSelected,widemode,Field,_http_referer,export_results");