function elasticsearch_connector_requirements in Elasticsearch Connector 7
Same name and namespace in other branches
- 8.7 elasticsearch_connector.install \elasticsearch_connector_requirements()
- 8 elasticsearch_connector.install \elasticsearch_connector_requirements()
- 8.2 elasticsearch_connector.install \elasticsearch_connector_requirements()
- 8.5 elasticsearch_connector.install \elasticsearch_connector_requirements()
- 8.6 elasticsearch_connector.install \elasticsearch_connector_requirements()
- 7.5 elasticsearch_connector.install \elasticsearch_connector_requirements()
- 7.2 elasticsearch_connector.install \elasticsearch_connector_requirements()
Implements hook_requirements().
Check Elastica installation.
File
- ./
elasticsearch_connector.install, line 13 - The installtion file for elasticsearch_connector module.
Code
function elasticsearch_connector_requirements($phase) {
$t = get_t();
if ($phase === 'install') {
if (version_compare(phpversion(), '5.3.9', '<')) {
return array(
'elasticsearch_connector' => array(
'title' => $t('The PHP version is not compatible with this module.'),
'description' => $t('The module requires PHP version bigger than or equal to version 5.3.9.'),
'severity' => REQUIREMENT_ERROR,
'value' => $t('PHP version not compatible.'),
),
);
}
}
if ($phase == 'runtime') {
if (!class_exists('\\Elasticsearch\\Client')) {
return array(
'elasticsearch_connector' => array(
'title' => $t('The Elasticsearch library is missing.'),
'description' => $t('The official library for Elasticsearch connection is missing.'),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Elasticsearch library missing.'),
),
);
}
else {
return array(
'elasticsearch_connector' => array(
'title' => $t('Elasticsearch PHP library'),
'description' => $t('The official Elasticsearch library was correctly installed.'),
'severity' => REQUIREMENT_OK,
'value' => $t('OK'),
),
);
}
}
return array();
}