function redis_requirements in Redis 8
Same name and namespace in other branches
- 7.3 redis.install \redis_requirements()
- 7 redis.install \redis_requirements()
- 7.2 redis.install \redis_requirements()
Implements hook_requirements().
File
- ./
redis.install, line 13 - Redis install related functions.
Code
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 [];
}
$requirements = [];
if (ClientFactory::hasClient()) {
$requirements['redis'] = [
'title' => "Redis",
'value' => t("Connected, using the <em>@name</em> client.", [
'@name' => ClientFactory::getClientName(),
]),
'severity' => REQUIREMENT_OK,
];
}
else {
$requirements['redis'] = [
'title' => "Redis",
'value' => t("Not connected."),
'severity' => REQUIREMENT_WARNING,
'description' => t("No Redis client connected, this module is therefore not used. Ensure that Redis is configured correctly, or disable this module."),
];
}
return $requirements;
}