# HG changeset patch # User Dan # Date 1240180941 14400 # Node ID 64572746941527d4966b899b6b741ee9e6603142 # Parent 32a43ae3649b844e945726c4d1f0af2bb74b425a DBAL: _die() now detects installation environment and, if present, calls installer UI library for error display chrome diff -r 32a43ae3649b -r 645727469415 includes/dbal.php --- a/includes/dbal.php Sun Apr 19 18:35:35 2009 -0400 +++ b/includes/dbal.php Sun Apr 19 18:42:21 2009 -0400 @@ -83,10 +83,14 @@ } function _die($t = '') { - if(defined('ENANO_HEADERS_SENT')) { + if ( defined('ENANO_HEADERS_SENT') ) + { ob_clean(); } - header('HTTP/1.1 500 Internal Server Error'); + + if ( !headers_sent() ) + header('HTTP/1.1 500 Internal Server Error'); + $bt = $this->latest_query; // $this->sql_backtrace(); $e = htmlspecialchars(mysql_error()); if($e=='') $e='<none>'; @@ -99,6 +103,15 @@ Error returned by MySQL extension: ' . $e . '
Most recent SQL query:

'.$bt.'
'; + if ( defined('IN_ENANO_INSTALL') && is_object(@$GLOBALS['ui']) ) + { + global $ui; + echo '

Database error!

'; + echo $internal_text; + $ui->show_footer(); + + exit; + } if(defined('ENANO_CONFIG_FETCHED')) die_semicritical('Database error', $internal_text); else grinding_halt('Database error', $internal_text); exit;