summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-04-11 05:37:03 +0200
committerThomas Lange <code@nerdmind.de>2017-04-11 05:37:03 +0200
commitdd0433cf81fe5329b694a148191f09e427d4a56c (patch)
tree0bd9e44cbf17120027b33c4dd1ae6394c89c902a
parent7a1b8f471ca133b6ca99cd4e440e6614a7c18537 (diff)
downloadblog-dd0433cf81fe5329b694a148191f09e427d4a56c.tar.gz
blog-dd0433cf81fe5329b694a148191f09e427d4a56c.tar.xz
blog-dd0433cf81fe5329b694a148191f09e427d4a56c.zip
Class "ExceptionHandler" has been removed and several files has been changed.
-rw-r--r--403.php2
-rw-r--r--404.php2
-rw-r--r--admin/auth.php2
-rw-r--r--admin/database.php2
-rw-r--r--admin/index.php2
-rw-r--r--admin/page/delete.php2
-rw-r--r--admin/page/index.php2
-rw-r--r--admin/page/insert.php2
-rw-r--r--admin/page/update.php2
-rw-r--r--admin/post/delete.php2
-rw-r--r--admin/post/index.php2
-rw-r--r--admin/post/insert.php2
-rw-r--r--admin/post/update.php2
-rw-r--r--admin/user/delete.php2
-rw-r--r--admin/user/index.php2
-rw-r--r--admin/user/insert.php2
-rw-r--r--admin/user/update.php2
-rw-r--r--core/namespace/Application.php6
-rw-r--r--core/namespace/ExceptionHandler.php8
-rw-r--r--core/namespace/Page/Exception.php2
-rw-r--r--core/namespace/Post/Exception.php2
-rw-r--r--core/namespace/Template/Exception.php2
-rw-r--r--core/namespace/User/Exception.php2
-rw-r--r--system/feed/main.php2
-rw-r--r--system/home.php2
-rw-r--r--system/page/list.php2
-rw-r--r--system/page/main.php4
-rw-r--r--system/post/list.php2
-rw-r--r--system/post/main.php4
-rw-r--r--system/search/main.php2
-rw-r--r--system/user/list.php2
-rw-r--r--system/user/main.php2
32 files changed, 35 insertions, 43 deletions
diff --git a/403.php b/403.php
index 7b6a168..7f914c0 100644
--- a/403.php
+++ b/403.php
@@ -27,6 +27,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/404.php b/404.php
index be2ca1b..10e3716 100644
--- a/404.php
+++ b/404.php
@@ -27,6 +27,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/auth.php b/admin/auth.php
index dbdd3ef..2608171 100644
--- a/admin/auth.php
+++ b/admin/auth.php
@@ -80,7 +80,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?>
diff --git a/admin/database.php b/admin/database.php
index 451e475..01c2dd7 100644
--- a/admin/database.php
+++ b/admin/database.php
@@ -47,6 +47,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/index.php b/admin/index.php
index c2ef0e0..0e59da1 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -83,6 +83,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/page/delete.php b/admin/page/delete.php
index 33d30a5..564273f 100644
--- a/admin/page/delete.php
+++ b/admin/page/delete.php
@@ -58,7 +58,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
diff --git a/admin/page/index.php b/admin/page/index.php
index 9a9bdfa..9dd5da1 100644
--- a/admin/page/index.php
+++ b/admin/page/index.php
@@ -71,6 +71,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/page/insert.php b/admin/page/insert.php
index f8a4cbf..367c154 100644
--- a/admin/page/insert.php
+++ b/admin/page/insert.php
@@ -81,6 +81,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/page/update.php b/admin/page/update.php
index 03f05ef..83a1e54 100644
--- a/admin/page/update.php
+++ b/admin/page/update.php
@@ -83,7 +83,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
diff --git a/admin/post/delete.php b/admin/post/delete.php
index f271364..af049fa 100644
--- a/admin/post/delete.php
+++ b/admin/post/delete.php
@@ -58,7 +58,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
diff --git a/admin/post/index.php b/admin/post/index.php
index ad735cd..e3f0a9d 100644
--- a/admin/post/index.php
+++ b/admin/post/index.php
@@ -71,6 +71,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/post/insert.php b/admin/post/insert.php
index baeacd3..ded732d 100644
--- a/admin/post/insert.php
+++ b/admin/post/insert.php
@@ -81,6 +81,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/post/update.php b/admin/post/update.php
index 37dccfe..7b14cee 100644
--- a/admin/post/update.php
+++ b/admin/post/update.php
@@ -83,7 +83,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
diff --git a/admin/user/delete.php b/admin/user/delete.php
index 5a1400a..00ae850 100644
--- a/admin/user/delete.php
+++ b/admin/user/delete.php
@@ -58,7 +58,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
diff --git a/admin/user/index.php b/admin/user/index.php
index 5f43eee..4125801 100644
--- a/admin/user/index.php
+++ b/admin/user/index.php
@@ -67,6 +67,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/user/insert.php b/admin/user/insert.php
index 7c892d4..1e6aa41 100644
--- a/admin/user/insert.php
+++ b/admin/user/insert.php
@@ -73,6 +73,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/admin/user/update.php b/admin/user/update.php
index 07965cd..0905791 100644
--- a/admin/user/update.php
+++ b/admin/user/update.php
@@ -76,7 +76,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 17cd020..36dd2cd 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -137,11 +137,11 @@ class Application {
}
#===============================================================================
- # Exit application with a custom HTTP status code
+ # Exit application with a custom message and status code
#===============================================================================
- public static function exit($code = 500) {
+ public static function exit($message = '', $code = 503) {
http_response_code($code);
- exit();
+ exit($message);
}
#===============================================================================
diff --git a/core/namespace/ExceptionHandler.php b/core/namespace/ExceptionHandler.php
deleted file mode 100644
index d64d74c..0000000
--- a/core/namespace/ExceptionHandler.php
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-abstract class ExceptionHandler extends Exception {
- public function defaultHandler($code = 503) {
- http_response_code(503);
- exit(parent::getMessage());
- }
-}
-?> \ No newline at end of file
diff --git a/core/namespace/Page/Exception.php b/core/namespace/Page/Exception.php
index d3aa06a..d4794b7 100644
--- a/core/namespace/Page/Exception.php
+++ b/core/namespace/Page/Exception.php
@@ -1,5 +1,5 @@
<?php
namespace Page;
-class Exception extends \ExceptionHandler {}
+class Exception extends \Exception {}
?> \ No newline at end of file
diff --git a/core/namespace/Post/Exception.php b/core/namespace/Post/Exception.php
index f752bf8..516ddbe 100644
--- a/core/namespace/Post/Exception.php
+++ b/core/namespace/Post/Exception.php
@@ -1,5 +1,5 @@
<?php
namespace Post;
-class Exception extends \ExceptionHandler {}
+class Exception extends \Exception {}
?> \ No newline at end of file
diff --git a/core/namespace/Template/Exception.php b/core/namespace/Template/Exception.php
index 52c522e..a38ee1d 100644
--- a/core/namespace/Template/Exception.php
+++ b/core/namespace/Template/Exception.php
@@ -1,5 +1,5 @@
<?php
namespace Template;
-class Exception extends \ExceptionHandler {}
+class Exception extends \Exception {}
?> \ No newline at end of file
diff --git a/core/namespace/User/Exception.php b/core/namespace/User/Exception.php
index be0a599..b5bcad0 100644
--- a/core/namespace/User/Exception.php
+++ b/core/namespace/User/Exception.php
@@ -1,5 +1,5 @@
<?php
namespace User;
-class Exception extends \ExceptionHandler {}
+class Exception extends \Exception {}
?> \ No newline at end of file
diff --git a/system/feed/main.php b/system/feed/main.php
index ffb9b3a..671f5c7 100644
--- a/system/feed/main.php
+++ b/system/feed/main.php
@@ -72,6 +72,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/system/home.php b/system/home.php
index 3d20097..ce91558 100644
--- a/system/home.php
+++ b/system/home.php
@@ -50,6 +50,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/system/page/list.php b/system/page/list.php
index 0879065..25409e5 100644
--- a/system/page/list.php
+++ b/system/page/list.php
@@ -60,6 +60,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/system/page/main.php b/system/page/main.php
index 22d0ec7..925d5d9 100644
--- a/system/page/main.php
+++ b/system/page/main.php
@@ -59,7 +59,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
@@ -86,5 +86,5 @@ catch(Page\Exception $Exception) {
# CATCH: User\Exception
#===============================================================================
catch(User\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
} \ No newline at end of file
diff --git a/system/post/list.php b/system/post/list.php
index 908f7b8..f2edd0b 100644
--- a/system/post/list.php
+++ b/system/post/list.php
@@ -60,6 +60,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/system/post/main.php b/system/post/main.php
index 0b69023..46937f3 100644
--- a/system/post/main.php
+++ b/system/post/main.php
@@ -59,7 +59,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}
@@ -86,5 +86,5 @@ catch(Post\Exception $Exception) {
# CATCH: User\Exception
#===============================================================================
catch(User\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
} \ No newline at end of file
diff --git a/system/search/main.php b/system/search/main.php
index 97fe8bb..8854b79 100644
--- a/system/search/main.php
+++ b/system/search/main.php
@@ -85,6 +85,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/system/user/list.php b/system/user/list.php
index 2e1e4f1..692bba6 100644
--- a/system/user/list.php
+++ b/system/user/list.php
@@ -56,6 +56,6 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
?> \ No newline at end of file
diff --git a/system/user/main.php b/system/user/main.php
index 8b7bc79..7944f1f 100644
--- a/system/user/main.php
+++ b/system/user/main.php
@@ -74,7 +74,7 @@ try {
# CATCH: Template\Exception
#===============================================================================
catch(Template\Exception $Exception) {
- $Exception->defaultHandler();
+ Application::exit($Exception->getMessage());
}
}