Skip to content

Commit

Permalink
bug #29436 [Cache] Fixed Memcached adapter doClear()to call flush() (…
Browse files Browse the repository at this point in the history
…raitocz)

This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #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 | #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()
  • Loading branch information
nicolas-grekas committed Dec 6, 2018
2 parents 317a2f9 + 447baac commit 922e13c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -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());
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/MemcachedTrait.php
Expand Up @@ -260,7 +260,7 @@ protected function doDelete(array $ids)
*/
protected function doClear($namespace)
{
return false;
return '' === $namespace && $this->getClient()->flush();
}

private function checkResultCode($result)
Expand Down

0 comments on commit 922e13c

Please sign in to comment.