CC-2989: airtime-check-system should deal with the case when the web server is not accessible
This commit is contained in:
parent
7c42a2f093
commit
aace5d0776
1 changed files with 7 additions and 4 deletions
|
@ -53,7 +53,6 @@ class AirtimeCheck {
|
||||||
self::output_status("AIRTIME_STATUS_URL", $url);
|
self::output_status("AIRTIME_STATUS_URL", $url);
|
||||||
$url = str_replace("%%api_key%%", $p_apiKey, $url);
|
$url = str_replace("%%api_key%%", $p_apiKey, $url);
|
||||||
|
|
||||||
|
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
|
|
||||||
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
|
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
|
||||||
|
@ -105,15 +104,19 @@ class AirtimeCheck {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::$AIRTIME_STATUS_OK){
|
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);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
echo PHP_EOL."-- There appears to be a problem with your Airtime installation.".PHP_EOL;
|
self::output_comment("There appears to be a problem with your Airtime installation.");
|
||||||
echo "-- Please visit http://wiki.sourcefabric.org/x/HABQ".PHP_EOL;
|
self::output_comment("Please visit http://wiki.sourcefabric.org/x/HABQ");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function output_comment($comment){
|
||||||
|
echo PHP_EOL."-- $comment".PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
public static function output_status($key, $value){
|
public static function output_status($key, $value){
|
||||||
global $showColor;
|
global $showColor;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue