From 5e4787d64cc4e70d115e5982f6d1b3bf6ffa5afe Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 28 Feb 2006 02:58:03 +0000 Subject: a little refactoring of autoload and error handler initialization. --- framework/prado.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'framework/prado.php') diff --git a/framework/prado.php b/framework/prado.php index eb38ae9d..59268105 100644 --- a/framework/prado.php +++ b/framework/prado.php @@ -38,20 +38,14 @@ if(!function_exists('__autoload')) { function __autoload($className) { - include_once($className.Prado::CLASS_FILE_EXT); - if(!class_exists($className,false) && !interface_exists($className,false)) - Prado::fatalError("Class file for '$className' cannot be found."); + Prado::autoload($className); } } /** - * Sets error handler to be Prado::phpErrorHandler + * Initializes error and exception handlers */ -set_error_handler(array('Prado','phpErrorHandler'),error_reporting()); -/** - * Sets exception handler to be Prado::exceptionHandler - */ -set_exception_handler(array('Prado','exceptionHandler')); +Prado::initErrorHandlers(); /** * Includes TApplication class file -- cgit v1.2.3