summaryrefslogtreecommitdiff
path: root/framework/Exceptions/TErrorHandler.php
diff options
context:
space:
mode:
authorxue <>2005-11-20 02:59:17 +0000
committerxue <>2005-11-20 02:59:17 +0000
commite0c69d2e0ca0e3a82ac04ede422af8996c0d7ff9 (patch)
treea3ee4ba8976a72e986b02dda3f65103c091755ba /framework/Exceptions/TErrorHandler.php
parent8b157421c027e455a3b52c28f08d328236a7d05f (diff)
Diffstat (limited to 'framework/Exceptions/TErrorHandler.php')
-rw-r--r--framework/Exceptions/TErrorHandler.php6
1 files changed, 4 insertions, 2 deletions
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);