TEMP : try to return an array to make the Json Conversion
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent 35d7b5ecbe
commit 9d02ee212c

@ -29,16 +29,16 @@ try{
$parameters = $request->getQueryParams(); $parameters = $request->getQueryParams();
$method = $parameters['method']; $method = $parameters['method'];
unset($parameters['method']); unset($parameters['method']);
$response->getBody()->write($method);
$listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion"); $listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion");
foreach ($listGateway as $gateway) // Pour chaque Gateway foreach ($listGateway as $gateway) // Pour chaque Gateway
{ {
if (method_exists($gateway, $method)) { if (method_exists($gateway, $method)) {
$response->getBody()->write((new $gateway)->$method($parameters)); // Si oui, on appelle cette fonction //$response->getBody()->write(print_r((new $gateway)->$method($parameters))); // Si oui, on appelle cette fonction
$response->getBody()->write(print_r(array('response' => "Rien", 'test' => "Test Ici")));
} }
} }
return $response; //return $response;
//return $response->withHeader('Content-type', 'application/json'); return $response->withHeader('Content-type', 'application/json');
}); });
}catch (TypeError $t){ }catch (TypeError $t){
echo "Error, wrong parameters key, or no parameters write : ".$t->getMessage(); echo "Error, wrong parameters key, or no parameters write : ".$t->getMessage();

Loading…
Cancel
Save