You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
658 B
25 lines
658 B
<?php
|
|
|
|
class APIController
|
|
{
|
|
public function __construct()
|
|
{
|
|
try {
|
|
if (empty($_REQUEST['action'])) {
|
|
$action = null;
|
|
} else {
|
|
$action = $_REQUEST['action'];
|
|
}
|
|
$listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion");
|
|
foreach ($listGateway as $gateway) {
|
|
if (method_exists($gateway, $action)) {
|
|
(new $gateway)->$action();
|
|
}
|
|
}
|
|
} catch (PDOException) {
|
|
return http_response_code(404);
|
|
}
|
|
exit(0);
|
|
}
|
|
}
|