You are here

public static function ShareaholicUtilities::connectivity_check in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3

Same name and namespace in other branches
  1. 8 utilities.php \ShareaholicUtilities::connectivity_check()

Server Connectivity check

1 call to ShareaholicUtilities::connectivity_check()
shareaholic_admin_advanced.tpl.php in templates/shareaholic_admin_advanced.tpl.php

File

./utilities.php, line 787

Class

ShareaholicUtilities

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";
  }
}