aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-11-16 01:32:48 -0500
committerThedro Neely <thedroneely@gmail.com>2022-11-16 01:32:48 -0500
commite6d95488be4310b8bd85854c541777bb26299658 (patch)
treea77802b60cc2c87414407170fd3528f83fe20638 /bootstrap
parent0ca13d03f3bca48f1f50119bbc6887f5c0ce43ed (diff)
downloadedwinmattiacci.com-e6d95488be4310b8bd85854c541777bb26299658.tar.gz
edwinmattiacci.com-e6d95488be4310b8bd85854c541777bb26299658.tar.bz2
edwinmattiacci.com-e6d95488be4310b8bd85854c541777bb26299658.zip
app: Cleanup dead files and organize hierarchy
Diffstat (limited to 'bootstrap')
-rw-r--r--bootstrap/Router.php6
-rw-r--r--bootstrap/Routes.php31
2 files changed, 2 insertions, 35 deletions
diff --git a/bootstrap/Router.php b/bootstrap/Router.php
index 34e278c..c78ab8b 100644
--- a/bootstrap/Router.php
+++ b/bootstrap/Router.php
@@ -1,6 +1,6 @@
<?php
-class Router
+final class Router
{
protected $routes = [
'GET' => [],
@@ -26,7 +26,7 @@ class Router
public static function load($file)
{
$router = new static;
- require $file;
+ include $file;
return $router;
}
@@ -35,8 +35,6 @@ class Router
if (is_array($this->routes[$requestType]) && array_key_exists($uri, $this->routes[$requestType])) {
return $this->routes[$requestType][$uri];
}
- // throw new Exception('No route defined for this URI: "'.$uri.'"');
-
die(http_response_code(404));
}
}
diff --git a/bootstrap/Routes.php b/bootstrap/Routes.php
deleted file mode 100644
index 33576e4..0000000
--- a/bootstrap/Routes.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/* public routes */
-
-$router->get('', '../controllers/index.controller.php');
-$router->get('contact', '../controllers/contact.controller.php');
-$router->get('wall', '../controllers/wall.controller.php');
-$router->get('comments', '../controllers/comments.controller.php');
-$router->get('about', '../controllers/about.controller.php');
-$router->get('hashget', '../controllers/comments.controller.php');
-$router->get('hashover', '../controllers/comments.controller.php');
-
-$router->head('', '../controllers/index.controller.php');
-$router->head('contact', '../controllers/contact.controller.php');
-$router->head('wall', '../controllers/wall.controller.php');
-$router->head('comments', '../controllers/comments.controller.php');
-$router->head('hashget', '../controllers/comments.controller.php');
-$router->head('hashover', '../controllers/comments.controller.php');
-
-$router->post('contact', '../controllers/contact.controller.php');
-$router->post('hashpost', '../controllers/comments.controller.php');
-
-/* backend routes */
-
-$router->get('latestajax', '../bootstrap/comments/backend/latest-ajax.php');
-$router->get('countlinkajax', '../bootstrap/comments/backend/count-link-ajax.php');
-
-$router->post('commentsajax', '../bootstrap/comments/backend/comments-ajax.php');
-$router->post('formactions', '../bootstrap/comments/backend/form-actions.php');
-$router->post('loadcomments', '../bootstrap/comments/backend/load-comments.php');
-$router->post('likecomment', '../bootstrap/comments/backend/like.php');