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

33 lines
940 B

<?php
class APIController
{
// private ScriptDatabase $script;
function __construct()
{
// $this->script = new ScriptDatabase();
// $this->script->executeScript();
try {
if (empty($_REQUEST['action'])) {
$action = NULL;
} else {
$action = $_REQUEST['action'];
}
$listGateway = array(""); //TODO : nom des différentes Gateway à mettre
foreach ($listGateway as $gateway) // Pour chaque Gateway
{
/* On regarde s'il implémente une fonction du même nom que l'action reçue */
if(method_exists($gateway, $action))
{
(new $gateway)->$action(); // Si oui, on appelle cette fonction
}
}
} catch (PDOException) {
return http_response_code(404);
}
exit(0);
}
}