From 4b19fd2feec385855cc12458aaec94e1514fb6c8 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 4 Nov 2006 03:03:17 +0000 Subject: Fixed #437. --- HISTORY | 1 + framework/Web/UI/TTemplateManager.php | 2 +- framework/prado.php | 15 ++++++--------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/HISTORY b/HISTORY index ec1a4615..c9eab97d 100644 --- a/HISTORY +++ b/HISTORY @@ -2,6 +2,7 @@ Version 3.0.6 December 4, 2006 ============================== BUG: Ticket#442 - TPageService getBasePath in namespace form (Qiang) BUG: TTableCell should render   only when Text is not set and there's no child (Qiang) +CHG: Ticket#437 - __autoload is replaced by spl_autoload_register (Qiang) CHG: constructUrl() now encodes & into & by default (Qiang) CHG: TRepeater does not render anymore for empty item template (Qiang) diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 4e71e4c1..326ca68d 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -695,7 +695,7 @@ class TTemplate extends TApplicationComponent implements ITemplate } catch(Exception $e) { - if($e->getErrorCode()==='template_format_invalid' || $e->getErrorCode()==='template_format_invalid2') + if(($e instanceof TException) && ($e->getErrorCode()==='template_format_invalid' || $e->getErrorCode()==='template_format_invalid2')) throw $e; if($matchEnd===0) $line=$this->_startingLine+1; diff --git a/framework/prado.php b/framework/prado.php index 2eeda291..4cf3ab3e 100644 --- a/framework/prado.php +++ b/framework/prado.php @@ -7,7 +7,7 @@ * available functionalities that enable PRADO component model and error handling mechanism. * * By including this file, the PHP error and exception handlers are set as - * PRADO handlers, and an __autoload function is provided that automatiically + * PRADO handlers, and an __autoload function is provided that automatically * loads a class file if the class is not defined. * * @author Qiang Xue @@ -34,15 +34,12 @@ if(!class_exists('Prado',false)) } /** - * Defines __autoload function if not defined. + * Registers the autoload function. + * Since Prado::autoload will report a fatal error if the class file + * cannot be found, if you have multiple autoloaders, Prado::autoload + * should be registered in the last. */ -if(!function_exists('__autoload')) -{ - function __autoload($className) - { - Prado::autoload($className); - } -} +spl_autoload_register(array('Prado','autoload')); /** * Initializes error and exception handlers -- cgit v1.2.3