mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Some altered error handling - there was still hard-coded output hanging over from before
git-svn-id: file:///svn/phpbb/trunk@5899 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
22ada4e282
commit
aa42a83b9e
1 changed files with 53 additions and 34 deletions
|
@ -446,13 +446,27 @@ class module
|
||||||
* Output an error message
|
* Output an error message
|
||||||
* If skip is true, return and continue execution, else exit
|
* If skip is true, return and continue execution, else exit
|
||||||
* @todo Really should change the caption based on $skip and calling code at some point
|
* @todo Really should change the caption based on $skip and calling code at some point
|
||||||
|
* @todo This needs testing with a large dataset that generates multiple errors
|
||||||
*/
|
*/
|
||||||
function error($error, $line, $file, $skip = false)
|
function error($error, $line, $file, $skip = false)
|
||||||
{
|
{
|
||||||
global $lang, $db;
|
global $lang, $db, $template;
|
||||||
|
|
||||||
if (!$skip)
|
if ($skip)
|
||||||
{
|
{
|
||||||
|
$template->assign_block_vars('checks', array(
|
||||||
|
'S_LEGEND' => true,
|
||||||
|
'LEGEND' => $lang['INST_ERR_FATAL'],
|
||||||
|
));
|
||||||
|
|
||||||
|
$template->assign_block_vars('checks', array(
|
||||||
|
'TITLE' => basename($file) . ' [ ' . $line . ' ]',
|
||||||
|
'RESULT' => '<b style="color:red">' . $error . '</b>',
|
||||||
|
));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
|
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 '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
|
||||||
echo '<head>';
|
echo '<head>';
|
||||||
|
@ -469,17 +483,9 @@ class module
|
||||||
echo ' <span class="corners-top"><span></span></span>';
|
echo ' <span class="corners-top"><span></span></span>';
|
||||||
echo ' <div id="content">';
|
echo ' <div id="content">';
|
||||||
echo ' <h1>' . $lang['INST_ERR_FATAL'] . '</h1>';
|
echo ' <h1>' . $lang['INST_ERR_FATAL'] . '</h1>';
|
||||||
}
|
|
||||||
|
|
||||||
echo ' <p>' . $lang['INST_ERR_FATAL'] . "</p>\n";
|
echo ' <p>' . $lang['INST_ERR_FATAL'] . "</p>\n";
|
||||||
echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
|
echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
|
||||||
echo ' <p><b>' . $error . "</b></p>\n";
|
echo ' <p><b>' . $error . "</b></p>\n";
|
||||||
|
|
||||||
if ($skip)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo ' </div>';
|
echo ' </div>';
|
||||||
echo ' <span class="corners-bottom"><span></span></span>';
|
echo ' <span class="corners-bottom"><span></span></span>';
|
||||||
echo ' </div>';
|
echo ' </div>';
|
||||||
|
@ -505,21 +511,34 @@ class module
|
||||||
*/
|
*/
|
||||||
function db_error($error, $sql, $line, $file, $skip = false)
|
function db_error($error, $sql, $line, $file, $skip = false)
|
||||||
{
|
{
|
||||||
global $lang, $db;
|
global $lang, $db, $template;
|
||||||
|
|
||||||
$this->page_header();
|
|
||||||
|
|
||||||
echo ' <h2 style="color:red;text-align:center">' . $lang['INST_ERR_FATAL'] . "</h2>\n";
|
|
||||||
echo ' <p>' . $lang['INST_ERR_FATAL_DB'] . "</p>\n";
|
|
||||||
echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
|
|
||||||
echo ' <p>SQL : ' . $sql . "</p>\n";
|
|
||||||
echo ' <p><b>' . $error . "</b></p>\n";
|
|
||||||
|
|
||||||
if ($skip)
|
if ($skip)
|
||||||
{
|
{
|
||||||
|
$template->assign_block_vars('checks', array(
|
||||||
|
'S_LEGEND' => true,
|
||||||
|
'LEGEND' => $lang['INST_ERR_FATAL'],
|
||||||
|
));
|
||||||
|
|
||||||
|
$template->assign_block_vars('checks', array(
|
||||||
|
'TITLE' => basename($file) . ' [ ' . $line . ' ]',
|
||||||
|
'RESULT' => '<b style="color:red">' . $error . '</b><br />» SQL:' . $sql,
|
||||||
|
));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$template->set_filenames(array(
|
||||||
|
'body' => 'install_error.html')
|
||||||
|
);
|
||||||
|
$this->page_header();
|
||||||
|
$this->generate_navigation();
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'MESSAGE_TITLE' => $lang['INST_ERR_FATAL_DB'],
|
||||||
|
'MESSAGE_BODY' => '<p>' . basename($file) . ' [ ' . $line . ' ]</p><p>SQL : ' . $sql . '</p><p><b>' . $error . '</b></p>',
|
||||||
|
));
|
||||||
|
|
||||||
$db->sql_close();
|
$db->sql_close();
|
||||||
$this->page_footer();
|
$this->page_footer();
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Add table
Reference in a new issue