From 63c5eacb95a37b9dfc5b1381f89c7b01cc91315d Mon Sep 17 00:00:00 2001 From: tracer Date: Sat, 22 Jan 2022 16:37:00 +0100 Subject: [PATCH] initial commit --- bindAPI/src/Controller/CheckController.php | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 bindAPI/src/Controller/CheckController.php diff --git a/bindAPI/src/Controller/CheckController.php b/bindAPI/src/Controller/CheckController.php new file mode 100644 index 0000000..6f9d4e2 --- /dev/null +++ b/bindAPI/src/Controller/CheckController.php @@ -0,0 +1,68 @@ +response == "pong") { + $result = true; + } else { + print("Error: $httpResponse" . PHP_EOL); + } + } else { + $result = $apiResult; + } + break; + case 401: + print("Missing or wrong API Key" . PHP_EOL); + break; + default: + print("Unhandled error: " . $httpResponse . PHP_EOL); + } + + } else { + $error = curl_error($curl); + print("Unknown error: $error" . PHP_EOL); + } + + curl_close($curl); + return $result; + } + +}