8000 bug #29436 [Cache] Fixed Memcached adapter doClear()to call flush() (… · raulfraile/symfony@922e13c · GitHub
[go: up one dir, main page]

Skip to content

Commit 922e13c

Browse files
bug symfony#29436 [Cache] Fixed Memcached adapter doClear()to call flush() (raitocz)
This PR was submitted for the master branch but it was squashed and merged into the 8000 3.4 branch instead (closes symfony#29436). Discussion ---------- [Cache] Fixed Memcached adapter doClear()to call flush() | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#29435 | License | MIT | Doc PR | symfony/symfony-docs MemcachedTrait now calls Memcached::flush via its client instead of just returning false. Commits ------- 447baac [Cache] Fixed Memcached adapter doClear()to call flush()
2 parents 317a2f9 + 447baac commit 922e13c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,9 @@ public function provideDsnWithOptions()
192192
array(\Memcached::OPT_SOCKET_RECV_SIZE => 1, \Memcached::OPT_SOCKET_SEND_SIZE => 2, \Memcached::OPT_RETRY_TIMEOUT => 8),
193193
);
194194
}
195+
196+
public function testClear()
197+
{
198+
$this->assertTrue($this->createCachePool()->clear());
199+
}
195200
}

src/Symfony/Component/Cache/Traits/MemcachedTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ protected function doDelete(array $ids)
260260
*/
261261
protected function doClear($namespace)
262262
{
263-
return false;
263+
return '' === $namespace && $this->getClient()->flush();
264264
}
265265

266266
private function checkResultCode($result)

0 commit comments

Comments
 (0)
0