You are here

public static function AcquiaSearchSolrEnvironment::isConnected in Acquia Connector 7.3

Checks connection to search index.

Parameters

array $environment: Search environment.

Return value

bool TRUE if case of successful connection, otherwise - FALSE.

2 calls to AcquiaSearchSolrEnvironment::isConnected()
AcquiaSearchSolrEnvironment::overriddenToReadOnly in acquia_search/includes/AcquiaSearchSolrEnvironment.php
Checks if environment is switched to read-only mode.
AcquiaSearchSolrEnvironment::override in acquia_search/includes/AcquiaSearchSolrEnvironment.php
Overrides search environments configuration.

File

acquia_search/includes/AcquiaSearchSolrEnvironment.php, line 80

Class

AcquiaSearchSolrEnvironment
Class AcquiaSearchSolrEnvironment.

Code

public static function isConnected(array $environment) {
  if (empty($environment['service_class']) || empty($environment['env_id'])) {
    return FALSE;
  }
  if (FALSE === self::isAcquiaServer($environment)) {
    return FALSE;
  }
  try {
    return self::ping($environment['env_id']);
  } catch (Exception $exception) {
    watchdog_exception('acquia_search_solr', $exception);
  }
  return FALSE;
}