From 32224b28a746c92f4a2668b11e898718defaaf03 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 24 Aug 2014 19:05:36 +0300 Subject: [PATCH] response via exception trap --- ipf/http/error404.php | 6 ------ ipf/router.php | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 8 deletions(-) delete mode 100644 ipf/http/error404.php diff --git a/ipf/http/error404.php b/ipf/http/error404.php deleted file mode 100644 index a6b1a9b..0000000 --- a/ipf/http/error404.php +++ /dev/null @@ -1,6 +0,0 @@ -response($req); } catch (IPF_Exception $e) { return self::response500($req, $e); } @@ -201,3 +201,16 @@ class IPF_Route } } +abstract class IPF_Router_Shortcut extends Exception +{ + public abstract function response($request); +} + +class IPF_HTTP_Error404 extends IPF_Router_Shortcut +{ + public function response($request) + { + return new IPF_HTTP_Response_NotFound($request); + } +} + -- 2.49.0