public static function ShareaholicUtilities::connectivity_check in Share Buttons, Related Posts, Content Analytics - Shareaholic 8
Same name and namespace in other branches
- 7.3 utilities.php \ShareaholicUtilities::connectivity_check()
Server Connectivity check
1 call to ShareaholicUtilities::connectivity_check()
File
- ./utilities.php, line 787 
Class
Code
public static function connectivity_check() {
  $health_check_url = self::API_URL . "/haproxy_health_check";
  $response = ShareaholicHttp::send($health_check_url, array(
    'method' => 'GET',
  ), true);
  if (is_array($response) && array_key_exists('body', $response)) {
    $response_code = $response['response']['code'];
    if ($response_code == "200") {
      return "SUCCESS";
    }
    else {
      return "FAIL";
    }
  }
  else {
    return "FAIL";
  }
}