Skip to content
Permalink
Browse files

Fix error when Memcached::getAllKeys() fails.

Refs #7546
  • Loading branch information...
markstory committed Oct 15, 2015
1 parent e0d2c45 commit e8a072673782187f584b7ea82f6ef8f2c6f38e97
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/Cache/Engine/MemcachedEngine.php
@@ -273,14 +273,18 @@ public function delete($key) {
*
* @param bool $check If true no deletes will occur and instead CakePHP will rely
* on key TTL values.
* @return bool True if the cache was successfully cleared, false otherwise
* @return bool True if the cache was successfully cleared, false otherwise. Will
* also return false if you are using a binary protocol.
*/
public function clear($check) {
if ($check) {
return true;
}
$keys = $this->_Memcached->getAllKeys();
if ($keys === false) {
return false;
}
foreach ($keys as $key) {
if (strpos($key, $this->settings['prefix']) === 0) {

0 comments on commit e8a0726

Please sign in to comment.
You can’t perform that action at this time.