From 447baacbadc7c233bb5f6eeb1d3aa4a56dba512d Mon Sep 17 00:00:00 2001 From: Raito Akehanareru Date: Fri, 30 Nov 2018 13:50:43 +0100 Subject: [PATCH] [Cache] Fixed Memcached adapter doClear()to call flush() --- .../Component/Cache/Tests/Adapter/MemcachedAdapterTest.php | 5 +++++ src/Symfony/Component/Cache/Traits/MemcachedTrait.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php index 59d28a33c1be..1f2f4d40acfa 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php @@ -192,4 +192,9 @@ public function provideDsnWithOptions() array(\Memcached::OPT_SOCKET_RECV_SIZE => 1, \Memcached::OPT_SOCKET_SEND_SIZE => 2, \Memcached::OPT_RETRY_TIMEOUT => 8), ); } + + public function testClear() + { + $this->assertTrue($this->createCachePool()->clear()); + } } diff --git a/src/Symfony/Component/Cache/Traits/MemcachedTrait.php b/src/Symfony/Component/Cache/Traits/MemcachedTrait.php index cf04f1cf8566..8160f1411616 100644 --- a/src/Symfony/Component/Cache/Traits/MemcachedTrait.php +++ b/src/Symfony/Component/Cache/Traits/MemcachedTrait.php @@ -260,7 +260,7 @@ protected function doDelete(array $ids) */ protected function doClear($namespace) { - return false; + return '' === $namespace && $this->getClient()->flush(); } private function checkResultCode($result)