ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
hook_sanitycheck.php File Reference

Go to the source code of this file.

Functions

 memcacheMonitor_hook_sanitycheck (&$hookinfo)
 Sanity check for memcache servers. More...
 

Function Documentation

◆ memcacheMonitor_hook_sanitycheck()

memcacheMonitor_hook_sanitycheck ( $hookinfo)

Sanity check for memcache servers.

This function verifies that all memcache servers work.

Parameters
array&$hookinfohookinfo

Definition at line 10 of file hook_sanitycheck.php.

References $hookinfo, $server, and SimpleSAML_Memcache\getRawStats().

10  {
11  assert('is_array($hookinfo)');
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...
Definition: Memcache.php:482
$server
Definition: getUserInfo.php:12
$hookinfo
Definition: index.php:7
+ Here is the call graph for this function: