From a3b48f1f3ad64998aec79ba2449c33ff2c88901d Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Tue, 28 Feb 2023 10:33:51 +0100 Subject: [PATCH] TEMP : try to use print_r --- Source/API/script/index.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Source/API/script/index.php b/Source/API/script/index.php index 3d0e787..2227ed3 100644 --- a/Source/API/script/index.php +++ b/Source/API/script/index.php @@ -34,19 +34,15 @@ try{ } unset($parameters['method']); $listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion"); - foreach ($listGateway as $gateway) // Pour chaque Gateway - { + foreach ($listGateway as $gateway){ if (method_exists($gateway, $method)) { - $response->getBody()->write(print_r((new $gateway)->$method($parameters))); // Si oui, on appelle cette fonction - + $response->getBody()->write(print_r((new $gateway)->$method($parameters))); } } $temp = array('response' => "Rien", 'test' => "Test Ici"); - foreach ($temp as $key => $value) { - $response->getBody()->write($key,$value); - } - return $response; - //return $response->withHeader('Content-type', 'application/json'); + $response->getBody()->write(print_r($temp)); + //return $response; + return $response->withHeader('Content-type', 'application/json'); }); }catch (TypeError $t){ echo "Error, wrong parameters key, or no parameters write : ".$t->getMessage();