summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim van Dijen <tvdijen@gmail.com>2017-01-29 13:04:28 +0100
committerGitHub <noreply@github.com>2017-01-29 13:04:28 +0100
commitbb6ce9f7c537c406b66cc2230d6b29644979d4a3 (patch)
tree7975aff3a8e0e9196186d919ffe40b1882578241
parent7aeb580d784f06c25ae73609df8c5fe18379f02c (diff)
downloadsimplesamlphp-bb6ce9f7c537c406b66cc2230d6b29644979d4a3.zip
simplesamlphp-bb6ce9f7c537c406b66cc2230d6b29644979d4a3.tar.gz
simplesamlphp-bb6ce9f7c537c406b66cc2230d6b29644979d4a3.tar.bz2
Raise exception when memcache-server is down
The exception was never raised because $stats will be array(false) on failure instead of just false.
-rw-r--r--lib/SimpleSAML/Memcache.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php
index a7caceb..199833d 100644
--- a/lib/SimpleSAML/Memcache.php
+++ b/lib/SimpleSAML/Memcache.php
@@ -439,8 +439,10 @@ class SimpleSAML_Memcache
foreach (self::getMemcacheServers() as $sg) {
$stats = $sg->getExtendedStats();
- if ($stats === false) {
- throw new Exception('Failed to get memcache server status.');
+ foreach ($stats as $server => $data) {
+ if ($data === false) {
+ throw new Exception('Failed to get memcache server status.');
+ }
}
$stats = SimpleSAML\Utils\Arrays::transpose($stats);