aboutsummaryrefslogtreecommitdiff
path: root/controllers/meta.php
blob: e567ac3b09eee7c445769f374304a023613ec10d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?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'),
};