From 77f7e14f788e2572cf154b2318debcddee17686f Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Wed, 20 Nov 2024 14:56:47 +0200 Subject: [PATCH] Adds phpdoc comments --- app/classes/server.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/classes/server.php b/app/classes/server.php index 0127ced..3bfafde 100644 --- a/app/classes/server.php +++ b/app/classes/server.php @@ -1,13 +1,33 @@ db = $database->getConnection(); } - // get Jilo Server status + /** + * Checks the status of a Jilo server by sending a GET request to its health endpoint. + * + * @param string $host The server hostname or IP address (default: '127.0.0.1'). + * @param int $port The port on which the server is running (default: 8080). + * @param string $endpoint The health check endpoint path (default: '/health'). + * @return bool True if the server returns a 200 OK status, otherwise false. + */ public function getServerStatus($host = '127.0.0.1', $port = 8080, $endpoint = '/health') { $url = "http://$host:$port$endpoint"; $options = [ @@ -28,7 +48,6 @@ class Server { return false; } - } ?>