From 12a74128ad47e706fd0acc6a3367cbe8bd4e7f1e Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 22 Nov 2005 12:39:09 +0000 Subject: --- .gitattributes | 26 +++++++-------- framework/Exceptions/TErrorHandler.php | 6 ++-- framework/Exceptions/error.html | 28 ----------------- framework/Exceptions/error404-en.html | 29 ----------------- framework/Exceptions/error404-zh.html | 29 ----------------- framework/Exceptions/error404.html | 29 ----------------- framework/Exceptions/error500-en.html | 29 ----------------- framework/Exceptions/error500-zh.html | 28 ----------------- framework/Exceptions/error500.html | 29 ----------------- framework/Exceptions/error503-en.html | 27 ---------------- framework/Exceptions/error503-zh.html | 27 ---------------- framework/Exceptions/error503.html | 27 ---------------- framework/Exceptions/exception-en.html | 40 ------------------------ framework/Exceptions/exception-zh.html | 40 ------------------------ framework/Exceptions/exception.html | 40 ------------------------ framework/Exceptions/templates/error.html | 28 +++++++++++++++++ framework/Exceptions/templates/error404-en.html | 29 +++++++++++++++++ framework/Exceptions/templates/error404-zh.html | 29 +++++++++++++++++ framework/Exceptions/templates/error404.html | 29 +++++++++++++++++ framework/Exceptions/templates/error500-en.html | 29 +++++++++++++++++ framework/Exceptions/templates/error500-zh.html | 28 +++++++++++++++++ framework/Exceptions/templates/error500.html | 29 +++++++++++++++++ framework/Exceptions/templates/error503-en.html | 27 ++++++++++++++++ framework/Exceptions/templates/error503-zh.html | 27 ++++++++++++++++ framework/Exceptions/templates/error503.html | 27 ++++++++++++++++ framework/Exceptions/templates/exception-en.html | 40 ++++++++++++++++++++++++ framework/Exceptions/templates/exception-zh.html | 40 ++++++++++++++++++++++++ framework/Exceptions/templates/exception.html | 40 ++++++++++++++++++++++++ 28 files changed, 418 insertions(+), 418 deletions(-) delete mode 100644 framework/Exceptions/error.html delete mode 100644 framework/Exceptions/error404-en.html delete mode 100644 framework/Exceptions/error404-zh.html delete mode 100644 framework/Exceptions/error404.html delete mode 100644 framework/Exceptions/error500-en.html delete mode 100644 framework/Exceptions/error500-zh.html delete mode 100644 framework/Exceptions/error500.html delete mode 100644 framework/Exceptions/error503-en.html delete mode 100644 framework/Exceptions/error503-zh.html delete mode 100644 framework/Exceptions/error503.html delete mode 100644 framework/Exceptions/exception-en.html delete mode 100644 framework/Exceptions/exception-zh.html delete mode 100644 framework/Exceptions/exception.html create mode 100644 framework/Exceptions/templates/error.html create mode 100644 framework/Exceptions/templates/error404-en.html create mode 100644 framework/Exceptions/templates/error404-zh.html create mode 100644 framework/Exceptions/templates/error404.html create mode 100644 framework/Exceptions/templates/error500-en.html create mode 100644 framework/Exceptions/templates/error500-zh.html create mode 100644 framework/Exceptions/templates/error500.html create mode 100644 framework/Exceptions/templates/error503-en.html create mode 100644 framework/Exceptions/templates/error503-zh.html create mode 100644 framework/Exceptions/templates/error503.html create mode 100644 framework/Exceptions/templates/exception-en.html create mode 100644 framework/Exceptions/templates/exception-zh.html create mode 100644 framework/Exceptions/templates/exception.html diff --git a/.gitattributes b/.gitattributes index f05a3c28..24b7d228 100644 --- a/.gitattributes +++ b/.gitattributes @@ -39,20 +39,20 @@ framework/Data/TSqliteCache.php -text framework/Data/TXmlDocument.php -text framework/Exceptions/TErrorHandler.php -text framework/Exceptions/TException.php -text -framework/Exceptions/error.html -text -framework/Exceptions/error404-en.html -text -framework/Exceptions/error404-zh.html -text -framework/Exceptions/error404.html -text -framework/Exceptions/error500-en.html -text -framework/Exceptions/error500-zh.html -text -framework/Exceptions/error500.html -text -framework/Exceptions/error503-en.html -text -framework/Exceptions/error503-zh.html -text -framework/Exceptions/error503.html -text -framework/Exceptions/exception-en.html -text -framework/Exceptions/exception-zh.html -text -framework/Exceptions/exception.html -text framework/Exceptions/messages.txt -text +framework/Exceptions/templates/error.html -text +framework/Exceptions/templates/error404-en.html -text +framework/Exceptions/templates/error404-zh.html -text +framework/Exceptions/templates/error404.html -text +framework/Exceptions/templates/error500-en.html -text +framework/Exceptions/templates/error500-zh.html -text +framework/Exceptions/templates/error500.html -text +framework/Exceptions/templates/error503-en.html -text +framework/Exceptions/templates/error503-zh.html -text +framework/Exceptions/templates/error503.html -text +framework/Exceptions/templates/exception-en.html -text +framework/Exceptions/templates/exception-zh.html -text +framework/Exceptions/templates/exception.html -text framework/IO/TTextWriter.php -text framework/Security/TAuthManager.php -text framework/Security/TAuthorizationRule.php -text diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index 779224ca..592ba615 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -175,7 +175,7 @@ class TErrorHandler extends TComponent implements IModule if(!($exception instanceof THttpException)) error_log($exception->__toString()); if($this->_templatePath===null) - $this->_templatePath=dirname(__FILE__); + $this->_templatePath=Prado::getFrameworkPath().'/Exceptions/templates'; $base=$this->_templatePath.'/'.self::ERROR_FILE_NAME; $lang=Prado::getPreferredLanguage(); if(is_file("$base$statusCode-$lang.html")) @@ -276,9 +276,9 @@ class TErrorHandler extends TComponent implements IModule strftime('%Y-%m-%d %H:%m',time()) ); $lang=Prado::getPreferredLanguage(); - $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; + $exceptionFile=Prado::getFrameworkPath().'/Exceptions/templates/'.self::EXCEPTION_FILE_NAME.'-'.$lang.'.html'; if(!is_file($exceptionFile)) - $exceptionFile=dirname(__FILE__).'/'.self::EXCEPTION_FILE_NAME.'.html'; + $exceptionFile=Prado::getFrameworkPath().'/Exceptions/templates/'.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); diff --git a/framework/Exceptions/error.html b/framework/Exceptions/error.html deleted file mode 100644 index cff0f910..00000000 --- a/framework/Exceptions/error.html +++ /dev/null @@ -1,28 +0,0 @@ - - -%%ErrorMessage%% - - - - -

Error %%StatusCode%%

-

%%ErrorMessage%%

-

-The above error happened when the server was processing your request. -

-

-If you think this is a server error, please contact the webmaster. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error404-en.html b/framework/Exceptions/error404-en.html deleted file mode 100644 index 11585661..00000000 --- a/framework/Exceptions/error404-en.html +++ /dev/null @@ -1,29 +0,0 @@ - - -Page Not Found - - - - -

%%ErrorMessage%%

-

Error 404

-

-The requested URL was not found on this server. -If you entered the URL manually please check your spelling and try again. -

-

-If you think this is a server error, please contact the webmaster. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error404-zh.html b/framework/Exceptions/error404-zh.html deleted file mode 100644 index 98ec04d8..00000000 --- a/framework/Exceptions/error404-zh.html +++ /dev/null @@ -1,29 +0,0 @@ - - -无法找到页面 - - - - -

%%ErrorMessage%%

-

错误代码404

-

-服务器无法找到您所请求的页面。 -如果您是手工输入页面地址的,请检查拼写是否正确。 -

-

-如果您确认这是服务器错误,请联系系统管理员。 -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error404.html b/framework/Exceptions/error404.html deleted file mode 100644 index 11585661..00000000 --- a/framework/Exceptions/error404.html +++ /dev/null @@ -1,29 +0,0 @@ - - -Page Not Found - - - - -

%%ErrorMessage%%

-

Error 404

-

-The requested URL was not found on this server. -If you entered the URL manually please check your spelling and try again. -

-

-If you think this is a server error, please contact the webmaster. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error500-en.html b/framework/Exceptions/error500-en.html deleted file mode 100644 index 2f0901fb..00000000 --- a/framework/Exceptions/error500-en.html +++ /dev/null @@ -1,29 +0,0 @@ - - -Internal Server Error - - - - -

Internal Server Error

-

%%ErrorMessage%%

-

-An internal error occurred while the Web server was handling your request. -Please contact the webmaster to report this problem. -

-

-Thank you. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error500-zh.html b/framework/Exceptions/error500-zh.html deleted file mode 100644 index 4c7f6436..00000000 --- a/framework/Exceptions/error500-zh.html +++ /dev/null @@ -1,28 +0,0 @@ - - -服务器内部错误 - - - - -

服务器内部错误

-

%%ErrorMessage%%

-

-服务器在处理您的请求时发生了一个内部错误。请向系统管理员汇报这个错误。 -

-

-谢谢。 -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error500.html b/framework/Exceptions/error500.html deleted file mode 100644 index 2f0901fb..00000000 --- a/framework/Exceptions/error500.html +++ /dev/null @@ -1,29 +0,0 @@ - - -Internal Server Error - - - - -

Internal Server Error

-

%%ErrorMessage%%

-

-An internal error occurred while the Web server was handling your request. -Please contact the webmaster to report this problem. -

-

-Thank you. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error503-en.html b/framework/Exceptions/error503-en.html deleted file mode 100644 index 60527c45..00000000 --- a/framework/Exceptions/error503-en.html +++ /dev/null @@ -1,27 +0,0 @@ - - -Service Unavailable - - - - -

Service Unavailable

-

-Our system is currently under maintenance. Please come back later. -

-

-Thank you. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error503-zh.html b/framework/Exceptions/error503-zh.html deleted file mode 100644 index b6b5915c..00000000 --- a/framework/Exceptions/error503-zh.html +++ /dev/null @@ -1,27 +0,0 @@ - - -系统无法提供服务 - - - - -

系统无法提供服务

-

-系统维护中,请稍后再来访问。 -

-

-谢谢。 -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/error503.html b/framework/Exceptions/error503.html deleted file mode 100644 index 60527c45..00000000 --- a/framework/Exceptions/error503.html +++ /dev/null @@ -1,27 +0,0 @@ - - -Service Unavailable - - - - -

Service Unavailable

-

-Our system is currently under maintenance. Please come back later. -

-

-Thank you. -

-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/exception-en.html b/framework/Exceptions/exception-en.html deleted file mode 100644 index 67e15dfe..00000000 --- a/framework/Exceptions/exception-en.html +++ /dev/null @@ -1,40 +0,0 @@ - - -%%ErrorType%% - - - - -

%%ErrorType%%

-

Description

-

%%ErrorMessage%%

-

-

Source File

-

%%SourceFile%%

-
-
-%%SourceCode%%
-
-
-

Stack Trace

-
-
-%%StackTrace%%
-
-
-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/exception-zh.html b/framework/Exceptions/exception-zh.html deleted file mode 100644 index e0897688..00000000 --- a/framework/Exceptions/exception-zh.html +++ /dev/null @@ -1,40 +0,0 @@ - - -%%ErrorType%% - - - - -

%%ErrorType%%

-

错误信息

-

%%ErrorMessage%%

-

-

错误代码文件

-

%%SourceFile%%

-
-
-%%SourceCode%%
-
-
-

错误堆栈信息

-
-
-%%StackTrace%%
-
-
-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/exception.html b/framework/Exceptions/exception.html deleted file mode 100644 index 67e15dfe..00000000 --- a/framework/Exceptions/exception.html +++ /dev/null @@ -1,40 +0,0 @@ - - -%%ErrorType%% - - - - -

%%ErrorType%%

-

Description

-

%%ErrorMessage%%

-

-

Source File

-

%%SourceFile%%

-
-
-%%SourceCode%%
-
-
-

Stack Trace

-
-
-%%StackTrace%%
-
-
-
-%%Version%%
-%%Time%% -
- - \ No newline at end of file diff --git a/framework/Exceptions/templates/error.html b/framework/Exceptions/templates/error.html new file mode 100644 index 00000000..cff0f910 --- /dev/null +++ b/framework/Exceptions/templates/error.html @@ -0,0 +1,28 @@ + + +%%ErrorMessage%% + + + + +

Error %%StatusCode%%

+

%%ErrorMessage%%

+

+The above error happened when the server was processing your request. +

+

+If you think this is a server error, please contact the webmaster. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error404-en.html b/framework/Exceptions/templates/error404-en.html new file mode 100644 index 00000000..11585661 --- /dev/null +++ b/framework/Exceptions/templates/error404-en.html @@ -0,0 +1,29 @@ + + +Page Not Found + + + + +

%%ErrorMessage%%

+

Error 404

+

+The requested URL was not found on this server. +If you entered the URL manually please check your spelling and try again. +

+

+If you think this is a server error, please contact the webmaster. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error404-zh.html b/framework/Exceptions/templates/error404-zh.html new file mode 100644 index 00000000..98ec04d8 --- /dev/null +++ b/framework/Exceptions/templates/error404-zh.html @@ -0,0 +1,29 @@ + + +无法找到页面 + + + + +

%%ErrorMessage%%

+

错误代码404

+

+服务器无法找到您所请求的页面。 +如果您是手工输入页面地址的,请检查拼写是否正确。 +

+

+如果您确认这是服务器错误,请联系系统管理员。 +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error404.html b/framework/Exceptions/templates/error404.html new file mode 100644 index 00000000..11585661 --- /dev/null +++ b/framework/Exceptions/templates/error404.html @@ -0,0 +1,29 @@ + + +Page Not Found + + + + +

%%ErrorMessage%%

+

Error 404

+

+The requested URL was not found on this server. +If you entered the URL manually please check your spelling and try again. +

+

+If you think this is a server error, please contact the webmaster. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error500-en.html b/framework/Exceptions/templates/error500-en.html new file mode 100644 index 00000000..2f0901fb --- /dev/null +++ b/framework/Exceptions/templates/error500-en.html @@ -0,0 +1,29 @@ + + +Internal Server Error + + + + +

Internal Server Error

+

%%ErrorMessage%%

+

+An internal error occurred while the Web server was handling your request. +Please contact the webmaster to report this problem. +

+

+Thank you. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error500-zh.html b/framework/Exceptions/templates/error500-zh.html new file mode 100644 index 00000000..4c7f6436 --- /dev/null +++ b/framework/Exceptions/templates/error500-zh.html @@ -0,0 +1,28 @@ + + +服务器内部错误 + + + + +

服务器内部错误

+

%%ErrorMessage%%

+

+服务器在处理您的请求时发生了一个内部错误。请向系统管理员汇报这个错误。 +

+

+谢谢。 +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error500.html b/framework/Exceptions/templates/error500.html new file mode 100644 index 00000000..2f0901fb --- /dev/null +++ b/framework/Exceptions/templates/error500.html @@ -0,0 +1,29 @@ + + +Internal Server Error + + + + +

Internal Server Error

+

%%ErrorMessage%%

+

+An internal error occurred while the Web server was handling your request. +Please contact the webmaster to report this problem. +

+

+Thank you. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error503-en.html b/framework/Exceptions/templates/error503-en.html new file mode 100644 index 00000000..60527c45 --- /dev/null +++ b/framework/Exceptions/templates/error503-en.html @@ -0,0 +1,27 @@ + + +Service Unavailable + + + + +

Service Unavailable

+

+Our system is currently under maintenance. Please come back later. +

+

+Thank you. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error503-zh.html b/framework/Exceptions/templates/error503-zh.html new file mode 100644 index 00000000..b6b5915c --- /dev/null +++ b/framework/Exceptions/templates/error503-zh.html @@ -0,0 +1,27 @@ + + +系统无法提供服务 + + + + +

系统无法提供服务

+

+系统维护中,请稍后再来访问。 +

+

+谢谢。 +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/error503.html b/framework/Exceptions/templates/error503.html new file mode 100644 index 00000000..60527c45 --- /dev/null +++ b/framework/Exceptions/templates/error503.html @@ -0,0 +1,27 @@ + + +Service Unavailable + + + + +

Service Unavailable

+

+Our system is currently under maintenance. Please come back later. +

+

+Thank you. +

+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/exception-en.html b/framework/Exceptions/templates/exception-en.html new file mode 100644 index 00000000..67e15dfe --- /dev/null +++ b/framework/Exceptions/templates/exception-en.html @@ -0,0 +1,40 @@ + + +%%ErrorType%% + + + + +

%%ErrorType%%

+

Description

+

%%ErrorMessage%%

+

+

Source File

+

%%SourceFile%%

+
+
+%%SourceCode%%
+
+
+

Stack Trace

+
+
+%%StackTrace%%
+
+
+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/exception-zh.html b/framework/Exceptions/templates/exception-zh.html new file mode 100644 index 00000000..e0897688 --- /dev/null +++ b/framework/Exceptions/templates/exception-zh.html @@ -0,0 +1,40 @@ + + +%%ErrorType%% + + + + +

%%ErrorType%%

+

错误信息

+

%%ErrorMessage%%

+

+

错误代码文件

+

%%SourceFile%%

+
+
+%%SourceCode%%
+
+
+

错误堆栈信息

+
+
+%%StackTrace%%
+
+
+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file diff --git a/framework/Exceptions/templates/exception.html b/framework/Exceptions/templates/exception.html new file mode 100644 index 00000000..67e15dfe --- /dev/null +++ b/framework/Exceptions/templates/exception.html @@ -0,0 +1,40 @@ + + +%%ErrorType%% + + + + +

%%ErrorType%%

+

Description

+

%%ErrorMessage%%

+

+

Source File

+

%%SourceFile%%

+
+
+%%SourceCode%%
+
+
+

Stack Trace

+
+
+%%StackTrace%%
+
+
+
+%%Version%%
+%%Time%% +
+ + \ No newline at end of file -- cgit v1.2.3