Merge branch 'MDL-53967-master' of https://github.com/sk-unikent/moodle

This commit is contained in:
David Monllao 2016-05-02 10:15:26 +08:00
commit 9fdcce1680

View File

@ -508,9 +508,14 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
* @return array
*/
protected static function get_prefixed_keys(Memcached $connection, $prefix) {
$connkeys = $connection->getAllKeys();
if (empty($connkeys)) {
return array();
}
$keys = array();
$start = strlen($prefix);
foreach ($connection->getAllKeys() as $key) {
foreach ($connkeys as $key) {
if (strpos($key, $prefix) === 0) {
$keys[] = substr($key, $start);
}