You are here

function search_api_elasticsearch_requirements in Search API Elasticsearch 7.2

Implements hook_requirements().

File

./search_api_elasticsearch.install, line 11
Install/Uninstall/Update tasks for the Search API Elasticsearch module.

Code

function search_api_elasticsearch_requirements($phase) {
  $requirements = [];
  $t = get_t();
  if ($phase == 'runtime') {
    if (!class_exists('\\Elastica\\Client')) {
      $requirements['elastica'] = [
        'title' => $t('Elastica'),
        'description' => $t('Search API Elasticsearch requires the Elastica library (version 3.2.3) to be installed.'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }
  return $requirements;
}