aboutsummaryrefslogtreecommitdiff
path: root/controllers/meta.php
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/meta.php')
-rw-r--r--controllers/meta.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/controllers/meta.php b/controllers/meta.php
index e567ac3..e20bbfc 100644
--- a/controllers/meta.php
+++ b/controllers/meta.php
@@ -1,18 +1,13 @@
<?php
-foreach (glob("../models/*.php") as $filename) {
- include $filename;
-}
-
function call_handler(string $name) {
if (function_exists($name)) {
call_user_func($name);
}
}
-match ($_SERVER['REQUEST_METHOD']) {
- 'POST' => call_handler('on_post'),
- 'GET' => call_handler('on_get'),
- 'PUT' => call_handler('on_put'),
- 'DELETE' => call_handler('on_delete'),
+switch ($_SERVER['REQUEST_METHOD']) {
+ case 'POST': call_handler('Controller\on_post'); break;
+ case 'PUT': call_handler('Controller\on_put'); break;
+ case 'DELETE': call_handler('Controller\on_delete'); break;
};