summaryrefslogtreecommitdiffstats
path: root/core/namespace/Application.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-04-11 05:11:57 +0200
committerThomas Lange <code@nerdmind.de>2017-04-11 05:15:49 +0200
commit7a1b8f471ca133b6ca99cd4e440e6614a7c18537 (patch)
tree79e9e8fbd20db4db18e531eaa792bf20ed539ae9 /core/namespace/Application.php
parent6feb5fe0d45196af4a9b2b058cefdd15f6007522 (diff)
downloadblog-7a1b8f471ca133b6ca99cd4e440e6614a7c18537.tar.gz
blog-7a1b8f471ca133b6ca99cd4e440e6614a7c18537.tar.xz
blog-7a1b8f471ca133b6ca99cd4e440e6614a7c18537.zip
Methods "error403" and "error404" has been added to the "Application" class; several files has been changed.
Diffstat (limited to 'core/namespace/Application.php')
-rw-r--r--core/namespace/Application.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 329d56d..17cd020 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -137,11 +137,26 @@ class Application {
}
#===============================================================================
- # Exit application with
+ # Exit application with a custom HTTP status code
#===============================================================================
public static function exit($code = 500) {
http_response_code($code);
- $code === 404 AND require_once ROOT.'404.php';
+ exit();
+ }
+
+ #===============================================================================
+ # Exit application with the 403 error page
+ #===============================================================================
+ public static function error403() {
+ require_once ROOT.'403.php';
+ exit();
+ }
+
+ #===============================================================================
+ # Exit application with the 404 error page
+ #===============================================================================
+ public static function error404() {
+ require_once ROOT.'404.php';
exit();
}
}