|
|
@ -24,7 +24,7 @@ $app->addRoutingMiddleware();
|
|
|
|
* @param bool $logErrors -> Parameter is passed to the default ErrorHandler
|
|
|
|
* @param bool $logErrors -> Parameter is passed to the default ErrorHandler
|
|
|
|
* @param bool $logErrorDetails -> Display error details in error log
|
|
|
|
* @param bool $logErrorDetails -> Display error details in error log
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$errorMiddleware = $app->addErrorMiddleware(true, true, false);
|
|
|
|
$errorMiddleware = $app->addErrorMiddleware(true, true, true);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Add a route for the API
|
|
|
|
* Add a route for the API
|
|
|
@ -40,6 +40,7 @@ $app->get('/', function (Request $request, Response $response) {
|
|
|
|
$listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion");
|
|
|
|
$listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion");
|
|
|
|
$ok = false;
|
|
|
|
$ok = false;
|
|
|
|
foreach ($listGateway as $gateway){
|
|
|
|
foreach ($listGateway as $gateway){
|
|
|
|
|
|
|
|
echo implode(",",get_class_methods($gateway));
|
|
|
|
if (method_exists($gateway, $method)) {
|
|
|
|
if (method_exists($gateway, $method)) {
|
|
|
|
$ok = true;
|
|
|
|
$ok = true;
|
|
|
|
$response->getBody()->write(json_encode((new $gateway)->$method($parameters)));
|
|
|
|
$response->getBody()->write(json_encode((new $gateway)->$method($parameters)));
|
|
|
|