Skip to content

Commit

Permalink
MDL-47917 cachestore_memcached: fixed get_many ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Nov 3, 2014
1 parent 7deea8e commit 56d3791
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cache/stores/memcached/lib.php
Expand Up @@ -247,16 +247,19 @@ public function get($key) {
* be set to false.
*/
public function get_many($keys) {
$return = array();
$result = $this->connection->getMulti($keys);
if (!is_array($result)) {
$result = array();
}
foreach ($keys as $key) {
if (!array_key_exists($key, $result)) {
$result[$key] = false;
$return[$key] = false;
} else {
$return[$key] = $result[$key];
}
}
return $result;
return $return;
}

/**
Expand Down

0 comments on commit 56d3791

Please sign in to comment.