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.
SAE4.01_FORMULAIRE/Source/API/script/APIController.php

26 lines
696 B

<?php
class APIController
{
// private ScriptDatabase $script;
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);
}
}