39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Redis install related functions.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_requirements().
|
|
*/
|
|
function redis_requirements($phase) {
|
|
|
|
// This module is configured via settings.php file. Using any other phase
|
|
// than runtime to proceed to some consistency checks is useless.
|
|
if ('runtime' !== $phase) {
|
|
return array();
|
|
}
|
|
|
|
$requirements = array();
|
|
|
|
try {
|
|
Redis_Client::getClient();
|
|
$requirements['redis'] = array(
|
|
'title' => "Redis",
|
|
'value' => t("Connected, using the <em>@name</em> client.", array('@name' => Redis_Client::getClientInterfaceName())),
|
|
'severity' => REQUIREMENT_OK,
|
|
);
|
|
} catch (Exception $e) {
|
|
$requirements['redis'] = array(
|
|
'title' => "Redis",
|
|
'value' => t("Not connected."),
|
|
'severity' => REQUIREMENT_WARNING,
|
|
'description' => t("No Redis client connected. Please ensure that your Redis connection is working properly. If you are not using a Redis server connection you should disable this module."),
|
|
);
|
|
}
|
|
|
|
return $requirements;
|
|
}
|