summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2005-11-19 00:31:05 +0000
committerxue <>2005-11-19 00:31:05 +0000
commit95462e0eb735af4a54e8d72aed55bcc44efe0b52 (patch)
treed6cc10d0633785eb8ec45e94e1bcad6fede9f855 /framework
parent040ab8f2dac3560ff939c28f9e1dc59335f9d93c (diff)
Diffstat (limited to 'framework')
-rw-r--r--framework/Data/TXmlDocument.php1
-rw-r--r--framework/Exceptions/TErrorHandler.php18
2 files changed, 10 insertions, 9 deletions
diff --git a/framework/Data/TXmlDocument.php b/framework/Data/TXmlDocument.php
index ba3df190..0b37258d 100644
--- a/framework/Data/TXmlDocument.php
+++ b/framework/Data/TXmlDocument.php
@@ -303,6 +303,7 @@ class TXmlDocument extends TXmlElement
*/
public function loadFromString($string)
{
+ // TODO: since PHP 5.1, we can get parsing errors and throw them as exception
$doc=new DOMDocument();
if($doc->loadXML($string)===false)
return false;
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index efcbe831..b5919e5d 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -95,14 +95,14 @@ class TErrorHandler extends TComponent implements IModule
$lang=array_shift(explode('-',array_shift(Prado::getUserLanguages())));
if(!empty($lang) && !ctype_alpha($lang))
$lang='';
- if(is_file("$base$statusCode-$lang.tpl"))
- $errorFile="$base$statusCode-$lang.tpl";
- else if(is_file("$base$statusCode.tpl"))
- $errorFile="$base$statusCode.tpl";
- else if(is_file("$base-$lang.tpl"))
- $errorFile="$base-$lang.tpl";
+ if(is_file("$base$statusCode-$lang.html"))
+ $errorFile="$base$statusCode-$lang.html";
+ else if(is_file("$base$statusCode.html"))
+ $errorFile="$base$statusCode.html";
+ else if(is_file("$base-$lang.html"))
+ $errorFile="$base-$lang.html";
else
- $errorFile="$base.tpl";
+ $errorFile="$base.html";
if(($content=@file_get_contents($errorFile))===false)
die("Unable to open error template file '$errorFile'.");
@@ -178,9 +178,9 @@ class TErrorHandler extends TComponent implements IModule
$lang=array_shift(explode('-',array_shift(Prado::getUserLanguages())));
if(!empty($lang) && !ctype_alpha($lang))
$lang='';
- $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.tpl';
+ $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html';
if(!is_file($exceptionFile))
- $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'.tpl';
+ $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);