Go to the source code of this file.
◆ memcacheMonitor_hook_sanitycheck()
memcacheMonitor_hook_sanitycheck |
( |
& |
$hookinfo | ) |
|
Sanity check for memcache servers.
This function verifies that all memcache servers work.
- Parameters
-
Definition at line 10 of file hook_sanitycheck.php.
10 {
12 assert(array_key_exists(
'errors',
$hookinfo));
13 assert(array_key_exists(
'info',
$hookinfo));
14
15 try {
17 } catch (Exception $e) {
18 $hookinfo[
'errors'][] =
'[memcacheMonitor] Error parsing memcache configuration: ' . $e->getMessage();
19 return;
20 }
21
22 $allOK = TRUE;
23 foreach ($servers as $group) {
24 foreach ($group as
$server => $status) {
25 if ($status === FALSE) {
26 $hookinfo[
'errors'][] =
'[memcacheMonitor] No response from server: ' .
$server;
27 $allOK = FALSE;
28 }
29 }
30 }
31
32 if ($allOK) {
33 $hookinfo[
'info'][] =
'[memcacheMonitor] All servers responding.';
34 }
35}
static getRawStats()
Retrieve statistics directly in the form returned by getExtendedStats, for all server groups.
References $hookinfo, $server, and SimpleSAML_Memcache\getRawStats().