You are here

function install_check_localization_server in Drupal 9

Same name and namespace in other branches
  1. 8 core/includes/install.core.inc \install_check_localization_server()
  2. 10 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 1468
API functions for installing Drupal.

Code

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