You are here

public static function Messages::getServerAuthCheckMessage in Acquia Search 3.x

Get message describing authentication status for the given server.

Parameters

\Drupal\search_api\Entity\Server $server: Search server configuration entity.

Return value

array|\Drupal\Core\StringTranslation\TranslatableMarkup Solr server authentication status message.

Throws

\Drupal\search_api\SearchApiException

1 call to Messages::getServerAuthCheckMessage()
Messages::getSearchStatusMessage in src/Helper/Messages.php
Returns formatted message about Acquia Search connection details.

File

src/Helper/Messages.php, line 224

Class

Messages
Class Messages.

Namespace

Drupal\acquia_search\Helper

Code

public static function getServerAuthCheckMessage(Server $server) {
  if ($server
    ->getBackend()
    ->getSolrConnector()
    ->pingServer()) {
    return t('Requests to Solr core are passing authentication checks.');
  }
  return [
    '#markup' => '<span class="color-error">' . t('Solr core authentication check fails.') . '</span>',
  ];
}