forked from md-systems/redis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redis.install
40 lines (33 loc) · 1 KB
/
redis.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @file
* Redis install related functions.
*/
use \Drupal\redis\ClientFactory;
/**
* 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();
if (ClientFactory::hasClient()) {
$requirements['redis'] = array(
'title' => "Redis",
'value' => t("Connected, using the <em>@name</em> client.", array('@name' => ClientFactory::getClientName())),
'severity' => REQUIREMENT_OK,
);
}
else {
$requirements['redis'] = array(
'title' => "Redis",
'value' => t("Not connected."),
'severity' => REQUIREMENT_WARNING,
'description' => t("No Redis client connected, this module is useless thereof. Ensure that you enabled module using it or disable it."),
);
}
return $requirements;
}