CC-2989: airtime-check-system should deal with the case when the web server is not accessible

This commit is contained in:
Martin Konecny 2011-10-27 16:54:35 -04:00
parent 7c42a2f093
commit aace5d0776

View file

@ -53,7 +53,6 @@ class AirtimeCheck {
self::output_status("AIRTIME_STATUS_URL", $url);
$url = str_replace("%%api_key%%", $p_apiKey, $url);
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
@ -105,15 +104,19 @@ 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;