From aace5d0776bc57a6e042acaeece527108eee72a6 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 27 Oct 2011 16:54:35 -0400 Subject: [PATCH] CC-2989: airtime-check-system should deal with the case when the web server is not accessible --- utils/airtime-check-system.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index 5c98a7844..ff59586e6 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -52,7 +52,6 @@ class AirtimeCheck { $url = "http://localhost/api/status/format/json/api_key/%%api_key%%"; self::output_status("AIRTIME_STATUS_URL", $url); $url = str_replace("%%api_key%%", $p_apiKey, $url); - $ch = curl_init($url); @@ -105,14 +104,18 @@ class AirtimeCheck { } if (self::$AIRTIME_STATUS_OK){ - echo PHP_EOL."-- Your installation of Airtime looks OK!".PHP_EOL; + self::output_comment("Your installation of Airtime looks OK!"); exit(0); } else { - echo PHP_EOL."-- There appears to be a problem with your Airtime installation.".PHP_EOL; - echo "-- Please visit http://wiki.sourcefabric.org/x/HABQ".PHP_EOL; + self::output_comment("There appears to be a problem with your Airtime installation."); + self::output_comment("Please visit http://wiki.sourcefabric.org/x/HABQ"); exit(1); } } + + public static function output_comment($comment){ + echo PHP_EOL."-- $comment".PHP_EOL; + } public static function output_status($key, $value){ global $showColor;