From 43a46cc3d3d485a50c287d33ad94f044f8a6c46c Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 15 Sep 2006 20:44:52 +0000 Subject: --- system/codeigniter/Common.php | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'system/codeigniter') diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php index 6d76fb098..a4531a7d0 100644 --- a/system/codeigniter/Common.php +++ b/system/codeigniter/Common.php @@ -110,12 +110,7 @@ function &_get_config() */ function show_error($message) { - if ( ! class_exists('CI_Exceptions')) - { - include_once(BASEPATH.'libraries/Exceptions.php'); - } - - $error = new CI_Exceptions(); + $error =& _load_class('CI_Exceptions'); echo $error->show_error('An Error Was Encountered', $message); exit; } @@ -133,12 +128,7 @@ function show_error($message) */ function show_404($page = '') { - if ( ! class_exists('CI_Exceptions')) - { - include_once(BASEPATH.'libraries/Exceptions.php'); - } - - $error = new CI_Exceptions(); + $error =& _load_class('CI_Exceptions'); $error->show_404($page); exit; } @@ -163,20 +153,7 @@ function log_message($level = 'error', $message, $php_error = FALSE) return; } - if ( ! class_exists('CI_Log')) - { - include_once(BASEPATH.'libraries/Log.php'); - } - - if ( ! is_object($LOG)) - { - $LOG = new CI_Log( - $config['log_path'], - $config['log_threshold'], - $config['log_date_format'] - ); - } - + $LOG =& _load_class('CI_Log'); $LOG->write_log($level, $message, $php_error); } @@ -209,12 +186,7 @@ function _exception_handler($severity, $message, $filepath, $line) return; } - // Send the PHP error to the log file... - if ( ! class_exists('CI_Exceptions')) - { - include_once(BASEPATH.'libraries/Exceptions.php'); - } - $error = new CI_Exceptions(); + $error =& _load_class('CI_Exceptions'); // Should we display the error? // We'll get the current error_reporting level and add its bits -- cgit v1.2.3-24-g4f1b