From e0c69d2e0ca0e3a82ac04ede422af8996c0d7ff9 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 20 Nov 2005 02:59:17 +0000 Subject: --- framework/Exceptions/TErrorHandler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'framework/Exceptions/TErrorHandler.php') diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index d053619f..69166561 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -236,6 +236,7 @@ class TErrorHandler extends TComponent implements IModule $errorLine=$exception->getLine(); $beginLine=$errorLine-9>=0?$errorLine-9:0; $endLine=$errorLine+8<=count($lines)?$errorLine+8:count($lines); + $source=''; for($i=$beginLine;$i<$endLine;++$i) { @@ -247,6 +248,7 @@ class TErrorHandler extends TComponent implements IModule else $source.=highlight_string(sprintf("Line %4d: %s",$i+1,$lines[$i]),true); } + $fields=array( '%%ErrorType%%', '%%ErrorMessage%%', @@ -266,9 +268,9 @@ class TErrorHandler extends TComponent implements IModule strftime('%Y-%m-%d %H:%m',time()) ); $lang=Prado::getPreferredLanguage(); - $exceptionFile=$this->_templatePath.'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; + $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; if(!is_file($exceptionFile)) - $exceptionFile=$this->_templatePath.'/'.self::EXCEPTION_FILE_NAME.'.html'; + $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'.html'; if(($content=@file_get_contents($exceptionFile))===false) die("Unable to open exception template file '$exceptionFile'."); echo str_replace($fields,$values,$content); -- cgit v1.2.3