mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #7552 from cakephp/issue-7546
Fix error when Memcached::getAllKeys() fails.
This commit is contained in:
commit
d0e7a2fd38
1 changed files with 5 additions and 1 deletions
|
@ -273,7 +273,8 @@ class MemcachedEngine extends CacheEngine {
|
|||
*
|
||||
* @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) {
|
||||
|
@ -281,6 +282,9 @@ class MemcachedEngine extends CacheEngine {
|
|||
}
|
||||
|
||||
$keys = $this->_Memcached->getAllKeys();
|
||||
if ($keys === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (strpos($key, $this->settings['prefix']) === 0) {
|
||||
|
|
Loading…
Reference in a new issue