本文整理汇总了PHP中get_backtrace函数的典型用法代码示例。如果您正苦于以下问题:PHP get_backtrace函数的具体用法?PHP get_backtrace怎么用?PHP get_backtrace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_backtrace函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: installer_msg_handler
function installer_msg_handler($errno, $msg_text, $errfile, $errline)
{
global $phpbb_installer_container;
if (error_reporting() == 0) {
return true;
}
switch ($errno) {
case E_NOTICE:
case E_WARNING:
case E_USER_WARNING:
case E_USER_NOTICE:
$msg = '[phpBB debug] "' . $msg_text . '" in file ' . $errfile . ' on line ' . $errline;
try {
/** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
$iohandler = $phpbb_installer_container->get('installer.helper.iohandler');
$iohandler->add_warning_message($msg);
} catch (\phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception $e) {
print $msg;
}
break;
case E_USER_ERROR:
$msg = '<b>General Error:</b><br />' . $msg_text . '<br /> in file ' . $errfile . ' on line ' . $errline;
$backtrace = get_backtrace();
if ($backtrace) {
$msg .= '<br /><br />BACKTRACE<br />' . $backtrace;
}
throw new \phpbb\exception\runtime_exception($msg);
break;
case E_DEPRECATED:
return true;
break;
}
return false;
}
开发者ID:exussum12,项目名称:phpbb,代码行数:34,代码来源:startup.php
示例2: test
/**
*
* It yields error message if the $code is not TRUE or it echoes a number.
*
* @param $code
* @param null $good
* @param null $bad
*/
function test($code, $good = null, $bad = null)
{
static $_count_test = 0;
$_count_test++;
$tree = get_backtrace();
if ($code) {
echo "{$_count_test} ";
} else {
echo "\nERROR: ({$_count_test})\n{$bad}\n{$tree}\n";
exit;
}
}
开发者ID:thruthesky,项目名称:backend,代码行数:20,代码来源:function.php
示例3: error_fatal
function error_fatal($type, $message, $file, $line = 0)
{
switch ($type) {
case E_USER_ERROR:
$type_str = 'Error';
break;
case E_WARNING:
case E_USER_WARNING:
$type_str = 'Warning';
break;
case E_NOTICE:
case E_USER_NOTICE:
$type_str = 'Notice';
break;
case QUICKSILVER_QUERY_ERROR:
$type_str = 'Query Error';
break;
default:
$type_str = 'Unknown Error';
}
if (strstr($file, 'eval()')) {
$split = preg_split('/[\\(\\)]/', $file);
$file = $split[0];
$line = $split[1];
$message .= ' (in evaluated code)';
}
$details = null;
$backtrace = null;
if (strpos($message, 'Template not found') === false) {
$backtrace = get_backtrace();
}
if ($type != QUICKSILVER_QUERY_ERROR) {
if (strpos($message, 'mysql_fetch_array(): supplied argument') === false) {
$lines = null;
$details2 = null;
if (strpos($message, 'Template not found') !== false) {
$backtrace = "";
$trace = debug_backtrace();
$file = $trace[2]['file'];
$line = $trace[2]['line'];
}
if (file_exists($file)) {
$lines = file($file);
}
if ($lines) {
$details2 = "\n\t\t\t\t<span class='header'>Code:</span><br />\n\t\t\t\t<span class='code'>" . error_getlines($lines, $line) . '</span>';
}
} else {
$details2 = "\n\t\t\t<span class='header'>MySQL Said:</span><br />" . mysql_error() . '<br />';
}
$details .= "\n\t\t<span class='header'>{$type_str} [{$type}]:</span><br />\n\t\tThe error was reported on line <b>{$line}</b> of <b>{$file}</b><br /><br />{$details2}";
} else {
$details .= "\n\t\t<span class='header'>{$type_str} [{$line}]:</span><br />\n\t\tThis type of error is reported by MySQL.\n\t\t<br /><br /><span class='header'>Query:</span><br />{$file}<br />";
}
$checkbug = error_report($type, $message, $file, $line);
// IIS does not use $_SERVER['QUERY_STRING'] in the same way as Apache and might not set it
if (isset($_SERVER['QUERY_STRING'])) {
$temp_querystring = str_replace("&", "&", $_SERVER['QUERY_STRING']);
} else {
$temp_querystring = "";
}
return "\n\t<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n\t<html>\n\t<head>\n\t<title>Quicksilver Forums Error</title>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n\n\t<style type='text/css'>\n\tbody {font-size:12px; font-family: verdana, arial, helvetica, sans-serif; color:#000000; background-color:#ffffff}\n\thr {height:1px}\n\t.large {font-weight:bold; font-size:18px; color:#660000; background-color:transparent}\n\t.header {font-weight:bold; font-size:12px; color:#660000; background-color:transparent}\n\t.error {font-weight:bold; font-size:12px; color:#ff0000; background-color:transparent}\n\t.small {font-weight:bold; font-size:10px; color:#000000; background-color:transparent}\n\t.code {font-weight:normal; font-size:12px; font-family:courier new, fixedsys, serif}\n\t</style>\n\t</head>\n\n\t<body>\n\t<span class='large'>Quicksilver Forums has exited with an error</span><br /><br />\n\n\t<hr>\n\t<span class='error'>{$message}</span>\n\t<hr><br />\n\n\t{$details}\n\n\t<br /><hr><br />\n\n\t{$backtrace}\n\n\t<br /><hr><br />\n\t<a href='http://forums.quicksilverforums.com/index.php?a=forum&f=6' class='small'>Check status of problem (recommended)</a><br />\n\t<a href='{$_SERVER['PHP_SELF']}?{$temp_querystring}&debug=1' class='small'>View debug information (advanced)</a><br />\n\t<a href='{$_SERVER['PHP_SELF']}' class='small'>Return to the board</a>\n\t</body>\n\t</html>";
}
开发者ID:BackupTheBerlios,项目名称:qsf-svn,代码行数:63,代码来源:error.php
示例4: msg_handler
/**
* Error and message handler, call with trigger_error if read
*/
function msg_handler($errno, $msg_text, $errfile, $errline)
{
global $cache, $db, $auth, $template, $config, $user, $request;
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
// Do not display notices if we suppress them via @
if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE) {
return;
}
// Message handler is stripping text. In case we need it, we are possible to define long text...
if (isset($msg_long_text) && $msg_long_text && !$msg_text) {
$msg_text = $msg_long_text;
}
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
switch ($errno) {
case E_NOTICE:
case E_WARNING:
// Check the error reporting level and return if the error level does not match
// If DEBUG is defined the default level is E_ALL
if (($errno & (defined('DEBUG') ? E_ALL : error_reporting())) == 0) {
return;
}
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) {
$errfile = phpbb_filter_root_path($errfile);
$msg_text = phpbb_filter_root_path($msg_text);
$error_name = $errno === E_WARNING ? 'PHP Warning' : 'PHP Notice';
echo '<b>[phpBB Debug] ' . $error_name . '</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
// we are writing an image - the user won't see the debug, so let's place it in the log
if (defined('IMAGE_OUTPUT') || defined('IN_CRON')) {
add_log('critical', 'LOG_IMAGE_GENERATION_ERROR', $errfile, $errline, $msg_text);
}
// echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
}
return;
break;
case E_USER_ERROR:
if (!empty($user) && !empty($user->lang)) {
$msg_text = !empty($user->lang[$msg_text]) ? $user->lang[$msg_text] : $msg_text;
$msg_title = !isset($msg_title) ? $user->lang['GENERAL_ERROR'] : (!empty($user->lang[$msg_title]) ? $user->lang[$msg_title] : $msg_title);
$l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $phpbb_root_path . '">', '</a>');
$l_notify = '';
if (!empty($config['board_contact'])) {
$l_notify = '<p>' . sprintf($user->lang['NOTIFY_ADMIN_EMAIL'], $config['board_contact']) . '</p>';
}
} else {
$msg_title = 'General Error';
$l_return_index = '<a href="' . $phpbb_root_path . '">Return to index page</a>';
$l_notify = '';
if (!empty($config['board_contact'])) {
$l_notify = '<p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
}
}
$log_text = $msg_text;
$backtrace = get_backtrace();
if ($backtrace) {
$log_text .= '<br /><br />BACKTRACE<br />' . $backtrace;
}
if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_')) {
$msg_text = $log_text;
// If this is defined there already was some output
// So let's not break it
if (defined('IN_DB_UPDATE')) {
echo '<div class="errorbox">' . $msg_text . '</div>';
$db->sql_return_on_error(true);
phpbb_end_update($cache, $config);
}
}
if ((defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) {
// let's avoid loops
$db->sql_return_on_error(true);
add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text);
$db->sql_return_on_error(false);
}
// Do not send 200 OK, but service unavailable on errors
send_status_line(503, 'Service Unavailable');
garbage_collection();
// Try to not call the adm page data...
echo '<!DOCTYPE html>';
echo '<html dir="ltr">';
echo '<head>';
echo '<meta charset="utf-8">';
echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $msg_title . '</title>';
echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
echo 'a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } ';
echo '#wrap { padding: 0 20px 15px 20px; min-width: 615px; } #page-header { text-align: right; height: 40px; } #page-footer { clear: both; font-size: 1em; text-align: center; } ';
echo '.panel { margin: 4px 0; background-color: #FFFFFF; border: solid 1px #A9B8C2; } ';
echo '#errorpage #page-header a { font-weight: bold; line-height: 6em; } #errorpage #content { padding: 10px; } #errorpage #content h1 { line-height: 1.2em; margin-bottom: 0; color: #DF075C; } ';
echo '#errorpage #content div { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; } ';
echo "\n" . '/* ]]> */' . "\n";
echo '</style>';
echo '</head>';
echo '<body id="errorpage">';
echo '<div id="wrap">';
echo ' <div id="page-header">';
//.........这里部分代码省略.........
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:101,代码来源:functions.php
示例5: error
function error($type, $message, $file, $line = 0)
{
global $settings;
if (!(error_reporting() & $type)) {
return;
}
switch ($type) {
case E_USER_ERROR:
$type_str = 'Error';
break;
case E_WARNING:
case E_USER_WARNING:
$type_str = 'Warning';
break;
case E_NOTICE:
case E_USER_NOTICE:
$type_str = 'Notice';
break;
case E_STRICT:
$type_str = 'Strict Standards';
break;
case SANDBOX_QUERY_ERROR:
$type_str = 'Query Error';
break;
default:
$type = -1;
$type_str = 'Unknown Error';
}
$details = null;
$backtrace = get_backtrace();
if ($type != SANDBOX_QUERY_ERROR) {
if (strpos($message, 'mysql_fetch_array(): supplied argument') === false) {
$lines = null;
$details2 = null;
if (file_exists($file)) {
$lines = file($file);
}
if ($lines) {
$details2 = "Code:\n" . error_getlines($lines, $line);
}
} else {
$details2 = "MySQL Said:\n" . mysql_error() . "\n";
}
$details .= "{$type_str} [{$type}]:\n\n\t\tThe error was reported on line {$line} of {$file}\n\n\n\t\t{$details2}";
} else {
$details .= "{$type_str} [{$line}]:\n\n\t\tThis type of error is reported by MySQL.\n\n\n\t\tQuery:\n{$file}\n";
}
// IIS does not use $_SERVER['QUERY_STRING'] in the same way as Apache and might not set it
if (isset($_SERVER['QUERY_STRING'])) {
$querystring = str_replace('&', '&', $_SERVER['QUERY_STRING']);
} else {
$querystring = '';
}
// DO NOT allow this information into the error reports!!!
$details = str_replace($settings['db_name'], '****', $details);
$details = str_replace($settings['db_pass'], '****', $details);
$details = str_replace($settings['db_user'], '****', $details);
$details = str_replace($settings['db_host'], '****', $details);
$backtrace = str_replace($settings['db_name'], '****', $backtrace);
$backtrace = str_replace($settings['db_pass'], '****', $backtrace);
$backtrace = str_replace($settings['db_user'], '****', $backtrace);
$backtrace = str_replace($settings['db_host'], '****', $backtrace);
// Don't send it if this isn't available. Spamming mail servers is a bad bad thing.
// This will also email the user agent string, in case errors are being generated by evil bots.
if (isset($settings['error_email'])) {
$headers = "From: Your Sandbox Site <{$settings['error_email']}>\r\n" . "X-Mailer: PHP/" . phpversion();
$agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'N/A';
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';
$error_report = "Sandbox has exited with an error!\n";
$error_report .= "The error details are as follows:\n\nURL: http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?" . $querystring . "\n";
$error_report .= "Querying user agent: " . $agent . "\n";
$error_report .= "Querying IP: " . $ip . "\n\n";
$error_report .= $message . "\n\n" . $details . "\n\n" . $backtrace;
$error_report = str_replace(" ", " ", html_entity_decode($error_report));
@mail($settings['error_email'], "Sandbox Error Report", $error_report, $headers);
}
header('HTTP/1.0 500 Internal Server Error');
exit("\n<!DOCTYPE html>\n<html lang=\"en-US\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <meta name=\"robots\" content=\"noodp\" />\n <meta name=\"generator\" content=\"Sandbox\" />\n <title>Fatal Error</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"./skins/Default/styles.css\" />\n </head>\n <body>\n <div id=\"container\">\n <div id=\"header\">\n <div id=\"company\">\n <div class=\"logo\"></div>\n <div class=\"title\">\n <h1>Sandbox: Fatal Error</h1>\n <p style=\"font-size:11px\">Klingon: ... There has been an incident on Praxis ...<br />Captain Sulu: An \"incident\"?<br />Commander Rand: Do we report this, sir?<br />Captain Sulu: Are you kidding?</p>\n </div>\n </div>\n <ul id=\"navigation\">\n <li><a href=\"/\">Home</a></li>\n </ul>\n </div>\n\n <div id=\"fullscreen\">\n <div class=\"article\">\n <div class=\"title\" style=\"color:yellow\">Fatal Error</div>\n The Sandbox software has experienced a fatal error and is unable to process your request at this time. Unfortunately any data you may have sent has been lost, and we apologize for the inconvenience.<br /><br />\n A detailed report on exactly what went wrong has been sent to the site owner and will be investigated and resolved as quickly as possible.\n </div>\n </div>\n\n <div id=\"bottom\"> </div>\n </div>\n <div id=\"footer\">Powered by Sandbox © 2006-2015 Sam O'Connor [<a href=\"http://www.kiasyn.com\">Kiasyn</a>] and Roger Libiez [<a href=\"http://www.iguanadons.net\">Samson</a>]</div>\n</body>\n</html>");
}
开发者ID:biggtfish,项目名称:Sandbox,代码行数:79,代码来源:global.php
示例6: titania_backtrace
function titania_backtrace($exception = false)
{
if (titania::$config->display_backtrace == 3 || titania::$config->display_backtrace == 2 && titania::$access_level == TITANIA_ACCESS_TEAMS || titania::$config->display_backtrace == 1 && phpbb::$auth->acl_get('a_')) {
if ($exception !== false) {
return '<br /><br /><pre>' . var_export($exception->getTrace(), true) . '</pre>';
}
return '<br /><br /><pre>' . get_backtrace() . '</pre>';
}
}
开发者ID:kairion,项目名称:customisation-db,代码行数:9,代码来源:functions.php
示例7: getErrorString
public function getErrorString()
{
if (sys()->isSapcms1()) {
$str = $this->db->error;
$str .= "<hr>";
$str .= get_backtrace();
return $str;
} else {
return $this->db->error;
}
}
开发者ID:thruthesky,项目名称:backend,代码行数:11,代码来源:DatabaseLayer.php
示例8: sql_error
/**
* Errors handling
*/
function sql_error($sql = '')
{
global $lang;
// Set var to retrieve errored status
$this->sql_error_triggered = true;
$this->sql_error_sql = $sql;
$this->sql_error_returned = $this->_sql_error();
if (!$this->return_on_error && !defined('IN_INSTALL')) {
$message = '<b>SQL ERROR [ ' . SQL_LAYER . ' ]</b><br /><br />' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']';
// Show complete SQL error and path to administrators only
// Additionally show complete error on installation or if extended debug mode is enabled
// The DEBUG_EXTRA constant is for development only!
if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') && DEBUG_EXTRA == true) {
$backtrace = get_backtrace();
$message .= $sql ? '<br /><br /><b>SQL</b><br /><br />' . htmlspecialchars($sql) : '';
$message .= $backtrace ? '<br /><br /><b>BACKTRACE</b><br />' . $backtrace : '';
$message .= '<br />';
} else {
// If error occurs in initiating the session we need to use a pre-defined language string
// This could happen if the connection could not be established for example (then we are not able to grab the default language)
if (!isset($lang['SQL_ERROR_OCCURRED'])) {
$message .= '<br /><br />An sql error occurred while fetching this page. Please contact site administrator if this problem persists.';
} else {
$message .= '<br /><br />' . $lang['SQL_ERROR_OCCURRED'];
}
}
if ($this->transaction) {
$this->sql_transaction('rollback');
}
global $msg_code;
$msg_code = CRITICAL_MESSAGE;
$message = '<div style="text-align: left;">' . $message . '</div>';
if (strlen($message) > 1024) {
// We need to define $msg_long_text here to circumvent text stripping.
global $msg_long_text;
$msg_long_text = $message;
@trigger_error(false, E_USER_NOTICE);
}
@trigger_error($message, E_USER_NOTICE);
/*
$msg_text = $message;
$msg_title = isset($lang['Error']) ? $lang['Error'] : 'Error';
message_die($msg_code, $msg_text, $msg_title, __LINE__, __FILE__, $sql);
*/
}
if ($this->transaction) {
$this->sql_transaction('rollback');
}
return $this->sql_error_returned;
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:53,代码来源:mysql.php
示例9: stk_msg_handler
/**
* Support Toolkit Error handler
*
* A wrapper for the phpBB `msg_handler` function, which is mainly used
* to update variables before calling the actual msg_handler and is able
* to handle various special cases.
*
* @global type $stk_no_error
* @global string $phpbb_root_path
* @param type $errno
* @param string $msg_text
* @param type $errfile
* @param type $errline
* @return boolean
*/
function stk_msg_handler($errno, $msg_text, $errfile, $errline)
{
// First and foremost handle the case where phpBB calls trigger error
// but the STK really needs to continue.
global $critical_repair, $stk_no_error, $user;
if (!isset($user->lang['STK_FATAL_ERROR'])) {
stk_add_lang('common');
}
if ($stk_no_error === true) {
return true;
}
// Do not display notices if we suppress them via @
if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE) {
return;
}
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
// Ignore Strict and Deprecated notices
if (in_array($errno, array(E_STRICT, E_DEPRECATED))) {
return true;
}
// We encounter an error while in the ERK, this need some special treatment
$error_level = array(E_ERROR => 'Fatal error', E_WARNING => 'Runtime Error', E_PARSE => 'Parse error', E_NOTICE => 'Notice');
switch ($errno) {
case E_ERROR:
case E_PARSE:
case E_WARNING:
case E_NOTICE:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
$backtrace = get_backtrace();
$msg_text = '<br /><b>[phpBB Debug] PHP ' . $error_level[$errno] . ':</b> in file ' . phpbb_filter_root_path($errfile) . ' on line <b>' . $errline . ': ' . $msg_text . '</b><br />' . $backtrace . '';
break;
default:
break;
}
if (defined('IN_ERK')) {
$critical_repair->trigger_error($msg_text, $errno == E_USER_ERROR ? false : true);
} else {
if (!defined('IN_STK')) {
// We're encountering an error before the STK is fully loaded
// Set out own message if needed
if ($errno == E_USER_ERROR) {
$msg_text = $user->lang['STK_FATAL_ERROR'];
}
if (!isset($critical_repair)) {
$critical_repair = new critical_repair();
}
$critical_repair->trigger_error($msg_text, $errno == E_USER_ERROR ? false : true);
}
}
//-- Normal phpBB msg_handler
global $cache, $db, $auth, $template, $config, $user;
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
// Message handler is stripping text. In case we need it, we are possible to define long text...
if (isset($msg_long_text) && $msg_long_text && !$msg_text) {
$msg_text = $msg_long_text;
}
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
switch ($errno) {
case E_NOTICE:
case E_WARNING:
// Check the error reporting level and return if the error level does not match
// If DEBUG is defined the default level is E_ALL
if (($errno & (defined('DEBUG') ? E_ALL : error_reporting())) == 0) {
return;
}
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) {
$errfile = stk_filter_root_path($errfile);
$msg_text = stk_filter_root_path($msg_text);
$error_name = $errno === E_WARNING ? 'PHP Warning' : 'PHP Notice';
echo '<b>[phpBB Debug] ' . $error_name . '</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
// we are writing an image - the user won't see the debug, so let's place it in the log
if (defined('IMAGE_OUTPUT') || defined('IN_CRON')) {
add_log('critical', 'LOG_IMAGE_GENERATION_ERROR', $errfile, $errline, $msg_text);
}
echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
}
return;
break;
//.........这里部分代码省略.........
开发者ID:melvingb,项目名称:phpbb3.1-STK,代码行数:101,代码来源:functions.php
示例10: msg_handler
//.........这里部分代码省略.........
if (check_hp($_SERVER['HTTP_REFERER'])) {
?>
[<a href="<?php
echo htmlspecialchars($_SERVER['HTTP_REFERER']);
?>
">Return to last Page</a>]
<?php
}
?>
</p>
<h3>Error Message</h3>
<p><?php
echo $errtext;
?>
</p>
<h3>Error Details</h3>
<p>
<strong>File:</strong> <?php
echo $errfile;
?>
<br />
<strong>Line:</strong> <?php
echo $errline;
?>
<br />
<strong>Date:</strong> <?php
echo $errdate;
?>
</p>
<h3>Code Snippet</h3>
<?php
echo getErrorCodeSnippet($errfile, $errline);
?>
<h3>Backtrace</h3>
<?php
echo get_backtrace(2);
?>
<?php
if (count($error_handler_history) > 0) {
?>
<h3>Previous Notices and Warnings</h3>
<p>Additionally <?php
echo count($error_handler_history);
?>
notices and/or warnings occured:</p>
<ul>
<?php
foreach ($error_handler_history as $e) {
?>
<li>
<strong><?php
echo $errortype[$e['errno']];
?>
</strong>: <?php
echo $e['errtext'];
?>
<br />
File: <tt><?php
echo $e['errfile'];
?>
</tt> - Line: <tt><?php
echo $e['errline'];
?>
</tt>
</li>
<?php
}
?>
</ul>
<?php
}
?>
<h3>Contact</h3>
<p>Please notify the board administrator: <a href="mailto:<?php
echo $config['forenmail'];
?>
"><?php
echo $config['forenmail'];
?>
</a></p>
<h3>Copyright</h3>
<p>
Powered by <strong><a href="http://www.viscacha.org" target="_blank">Viscacha <?php
echo $config['version'];
?>
</a></strong><br />
Copyright © 2004-2009, The Viscacha Project
</p>
</body>
</html>
<?php
exit;
break;
default:
// E_STRICT
return;
// Do nothing
break;
}
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:101,代码来源:function.errorhandler.php
示例11: msg_handler
/**
* Error and message handler, call with trigger_error if reqd
*/
function msg_handler($errno, $msg_text, $errfile, $errline)
{
global $db, $template, $msg_title, $msg_long_text;
include('./lib/lang/error.php');
$msg_title = (isset($lang_error[$msg_text.'_TITLE'])) ? $lang_error[$msg_text.'_TITLE'] : $msg_text.'_TITLE';
$msg_text = (isset($lang_error[$msg_text.'_DESC'])) ? $lang_error[$msg_text.'_DESC'] : $msg_text.'_DESC';
switch ($errno)
{
case E_NOTICE:
case E_WARNING:
// Check the error reporting level and return if the error level does not match
// If DEBUG is defined the default level is E_ALL
if (($errno & ((defined('DEBUG')) ? E_ALL : error_reporting())) == 0)
{
return;
}
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false)
{
// flush the content, else we get a white page if output buffering is on
if ((int) @ini_get('output_buffering') === 1 || strtolower(@ini_get('output_buffering')) === 'on')
{
@ob_flush();
}
echo '<b>[Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
if(defined('DEBUG'))
{
echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
}
}
return;
break;
case E_USER_ERROR:
$msg_title = 'General Error';
$l_return_index = '<a href="./">Return to index page</a>';
$l_notify = '<p>Please notify the board administrator or webmaster: <a href="mailto:[email protected]?subject=Your Sexy Site&body=Fix this shit, niggers.">[email protected]</a></p>';
$db->sql_close();
// Do not send 200 OK, but service unavailable on errors
header('HTTP/1.1 503 Service Unavailable');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
echo '<title>' . $msg_title . '</title>';
echo '</head>';
echo '<body id="errorpage">';
echo '<div id="wrap">';
echo ' <div id="page-header">';
echo ' ' . $l_return_index;
echo ' </div>';
echo ' <div id="acp">';
echo ' <div class="panel">';
echo ' <div id="content">';
echo ' <h1>' . $msg_title . '</h1>';
echo ' <div>' . $msg_text . '</div>';
echo $l_notify;
echo ' </div>';
echo ' </div>';
echo ' </div>';
echo '</div>';
echo '</body>';
echo '</html>';
// On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
exit;
break;
case E_USER_WARNING:
case E_USER_NOTICE:
if(!defined('ROOT_URL'))
{
page_header();
}
$template->assign_vars(array(
'MESSAGE_TITLE' => $msg_title,
'MESSAGE_TEXT' => $msg_text,
));
$template->set_filenames(array(
'error' => 'error_body.html',
));
$template->display('error');
//.........这里部分代码省略.........
开发者ID:Ganonmaster,项目名称:Roadsterspot,代码行数:101,代码来源:functions.php
示例12: test
function test($code, $good = null, $bad = null)
{
static $_count_test = 0;
global $global_test_error;
$_count_test++;
$tree = get_backtrace();
if ($code) {
$path = path_run(2);
echo "<span style='font-size:100%;color:#7f7c85;' title='{$good} {$path}'>{$_count_test}</span> ";
} else {
echo "<span style='font-size:160%;color:red;' title='{$bad}'>{$_count_test}</span> ";
$global_test_error[] = $bad . $tree;
}
}
开发者ID:thruthesky,项目名称:overframe,代码行数:14,代码来源:helper.overframe.php
示例13: gym_error
/**
* gym_error(($errno, $msg_text, $errfile, $errline)
* Will properly handle error for all cases, admin always get full debug
* Partly based on msg_handler()
* @access private
*/
function gym_error($errno = 0, $msg_key = '', $errfile = '', $errline = '', $sql = '')
{
global $user, $phpbb_seo, $auth, $phpbb_root_path, $phpEx, $msg_title;
$http_codes = array(204 => 'HTTP/1.1 204 No Content', 400 => 'HTTP/1.1 400 Bad Request', 401 => 'HTTP/1.1 401 Unauthorized', 403 => 'HTTP/1.1 403 Forbidden', 404 => 'HTTP/1.1 404 Not Found', 405 => 'HTTP/1.1 405 Method Not Allowed', 406 => 'HTTP/1.1 406 Not Acceptable', 410 => 'HTTP/1.1 410 Gone', 500 => 'HTTP/1.1 500 Internal Server Error', 503 => 'HTTP/1.1 503 Service Unavailable');
$header = isset($http_codes[$errno]) ? $http_codes[$errno] : '';
$return_url = append_sid("{$phpbb_root_path}index.{$phpEx}");
if (!empty($user) && !empty($user->lang)) {
$msg_title = empty($msg_key) ? !empty($user->lang['GYM_ERROR_' . $errno]) ? $user->lang['GYM_ERROR_' . $errno] : (!empty($header) ? $header : $user->lang['GENERAL_ERROR']) : (!empty($user->lang[$msg_key]) ? $user->lang[$msg_key] : $msg_key);
$msg_text = !empty($user->lang[$msg_key . '_EXPLAIN']) ? $user->lang[$msg_key . '_EXPLAIN'] : (!empty($user->lang['GYM_ERROR_' . $errno . '_EXPLAIN']) ? $user->lang['GYM_ERROR_' . $errno . '_EXPLAIN'] : (!empty($msg_key) ? $msg_key : (!empty($header) ? $header : $msg_title)));
$l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $return_url . '">', '</a>');
if (($errno == 500 || $errno == 503) && !empty($config['board_contact'])) {
$msg_text .= '<p>' . sprintf($user->lang['NOTIFY_ADMIN_EMAIL'], $config['board_contact']) . '</p>';
}
} else {
$msg_title = 'GYM Sitemaps General Error';
$l_return_index = '<a href="' . $return_url . '">Return to index page</a>';
if (($errno == 500 || $errno == 503) && !empty($config['board_contact'])) {
$msg_text .= '<p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
}
}
$msg_text .= '<br/><br/>' . $l_return_index;
if (@$auth->acl_get('a_')) {
if (!empty($user->lang[$msg_key . '_EXPLAIN_ADMIN'])) {
$msg_text .= '<br/><br/>' . $user->lang[$msg_key . '_EXPLAIN_ADMIN'];
}
if (defined('DEBUG')) {
$msg_text .= '</p><br/><h2>Debug :</h2><p>' . (!empty($errfile) ? "<br/><b>File :</b> " . utf8_htmlspecialchars($errfile) . "<br/>" : '');
$msg_text .= !empty($errline) ? "<br/><b>Line :</b> " . utf8_htmlspecialchars($errline) . "<br/>" : '';
$msg_text .= !empty($sql) ? "<br/><b>Sql :</b> " . utf8_htmlspecialchars($sql) . "<br/>" : '';
$msg_text .= '</p><div style="font-size:12px">' . get_backtrace() . '</div><p>';
}
}
if (!empty($header)) {
header($header);
}
meta_refresh(5, $return_url);
trigger_error($msg_text);
$this->safe_exit();
return;
}
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:46,代码来源:gym_sitemaps.php
示例14: msg_handler
//.........这里部分代码省略.........
margin-left: 15px;
padding: 2px;
font-family: Monospace;
list-style: none;
}
.lineone {
padding:0 5px;
margin:2px 0;
background:#F9F9F9;
}
.center {
text-align: center;
}
.linetwo {
padding:0 5px;
margin:2px 0;
background:#FCFCFC;
}
.mark {
padding:0 5px;
margin:2px 0;
background: #eedddd;
color: #880000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<h1>General Error</h1>
<p class="center">
[<a href="<?php
echo $config['furl'];
?>
/index.php">Return to Index</a>]
<?php
if (check_hp($_SERVER['HTTP_REFERER'])) {
?>
[<a href="<?php
echo htmlspecialchars($_SERVER['HTTP_REFERER']);
?>
">Return to last Page</a>]
<?php
}
?>
</p>
<h3>Error Message</h3>
<p><strong><?php
echo $errortype[$errno];
?>
</strong>: <?php
echo $errtext;
?>
</p>
<h3>Error Details</h3>
<p>
File: <?php
echo $errfile;
?>
<br />
Line: <?php
echo $errline;
?>
<br />
Date: <?php
echo $errdate;
?>
<br />
</p>
<h3>Code Snippet</h3>
<?php
echo getErrorCodeSnippet($errfile, $errline);
?>
<h3>Backtrace</h3>
<?php
echo get_backtrace();
?>
<h3>Contact</h3>
<p>Please notify the board administrator: <a href="mailto:<?php
echo $config['forenmail'];
?>
"><?php
echo $config['forenmail'];
?>
</a></p>
<h3>Copyright</h3>
<p>
<strong><a href="http://www.viscacha.org" target="_blank">Viscacha <?php
echo $config['version'];
?>
</a></strong><br />
Copyright © by MaMo Net
</p>
</body>
</html>
<?php
exit;
break;
}
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:101,代码来源:function.phpcore.php
示例15: log_error
/**
* Log error messages
*
* @param string $message
* @param bool $log_in_file
* @param bool $exit
* @param int $error_type
* @param array $args
*
* @return null
* @access private
*/
private function log_error($message, $log_in_file = false, $exit = false, $error_type = E_USER_NOTICE, $args = array())
{
$error_timestamp = date('d-M-Y H:i:s Z');
$backtrace = '';
if ($this->ppde_controller_main->use_sandbox()) {
$backtrace = get_backtrace();
$backtrace = html_entity_decode(strip_tags(str_replace(array('<br />', "\n\n"), "\n", $backtrace)));
}
$message = str_replace('<br />', ';', $message);
if (sizeof($args)) {
$message .= "\n[args]\n";
foreach ($args as $key => $value) {
$value = urlencode($value);
$message .= $key . ' = ' . $value . ";\n";
}
unset($value);
}
if ($log_in_file) {
error_log(sprintf('[%s] %s %s', $error_timestamp, $message, $backtrace), 3, $this->root_path . 'store/ppde_transactions.log');
}
if ($exit) {
trigger_error($message, $error_type);
}
}
开发者ID:ErnadoO,项目名称:ext_paypal_donation,代码行数:36,代码来源:ipn_listener.php
示例16: sql_error
/**
* display sql error page
*/
function sql_error($sql = '')
{
global $auth, $user, $config;
// Set var to retrieve errored status
$this->sql_error_triggered = true;
$this->sql_error_sql = $sql;
$this->sql_error_returned = $this->_sql_error();
if (!$this->return_on_error) {
$message = 'SQL ERROR [ ' . $this->sql_layer . ' ]<br /><br />' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']';
// Show complete SQL error and path to administrators only
// Additionally show complete error on installation or if extended debug mode is enabled
// The DEBUG_EXTRA constant is for development only!
if (isset($auth) && $auth->acl_get('a_') || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) {
// Print out a nice backtrace...
$backtrace = get_backtrace();
|
请发表评论