Skip to content

Commit

Permalink
MDL-56675 cachestore_memcached: Check all connected servers for support
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed May 4, 2017
1 parent 77f1729 commit 28bf0a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cache/stores/memcached/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,13 @@ public function is_connection_ready() {
$safecombination = true;
}

if (!$safecombination && (version_compare($this->connection->getVersion(), '1.4.22') <= 0)) {
// This is memcached server version <= 1.4.22 which is a safe combination.
$safecombination = true;
if (!$safecombination) {
$allsafe = true;
foreach ($this->connection->getVersion() as $version) {
$allsafe = $allsafe && (version_compare($version, '1.4.22') <= 0);
}
// All memcached servers connected are version <= 1.4.22 which is a safe combination.
$safecombination = $allsafe;
}

if (!$safecombination) {
Expand Down

0 comments on commit 28bf0a0

Please sign in to comment.