You are here

function install_check_localization_server in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/install.core.inc \install_check_localization_server()

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.

1 call to install_check_localization_server()
install_check_translations in core/includes/install.core.inc
Checks installation requirements and reports any errors.

File

core/includes/install.core.inc, line 1396
API functions for installing Drupal.

Code

function install_check_localization_server($uri) {
  try {
    \Drupal::httpClient()
      ->head($uri);
    return TRUE;
  } catch (RequestException $e) {
    return FALSE;
  }
}