function install_check_localization_server

Same name in other branches
  1. 9 core/includes/install.core.inc \install_check_localization_server()
  2. 8.9.x core/includes/install.core.inc \install_check_localization_server()
  3. 11.x 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 1486

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.