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.
30 lines
809 B
30 lines
809 B
<?php
|
|
|
|
class APIController
|
|
{
|
|
function __construct()
|
|
{
|
|
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);
|
|
}
|
|
|
|
}
|