1 install.core.inc install_check_localization_server($uri)

Checks if the localization server can be contacted.

Parameters

string $uri: The URI to contact.

Return value

string: TRUE if the URI was contacted successfully, FALSE if not.

File

core/includes/install.core.inc, line 1571
API functions for installing Backdrop.

Code

function install_check_localization_server($uri) {
  // Check only if a previous check in this page request returned TRUE.
  $online = &backdrop_static(__FUNCTION__, TRUE);
  if (!$online) {
    return FALSE;
  }

  $options = array(
    'method' => 'HEAD',
    'timeout' => 5,
  );
  $response = backdrop_http_request($uri, $options);
  if ($response->code != 200) {
    $online = FALSE;
    return $online;
  }
  return TRUE;
}