File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
src/Symfony/Component/Cache/Adapter Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ protected function doHave($id)
5050 */
5151 protected function doClear ($ namespace )
5252 {
53- return apcu_clear_cache ();
53+ return isset ($ namespace [0 ]) && class_exists ('APCuIterator ' , false )
54+ ? apcu_delete (new \APCuIterator (sprintf ('/^%s/ ' , preg_quote ($ namespace , '/ ' ))))
55+ : apcu_clear_cache ();
5456 }
5557
5658 /**
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ class DoctrineAdapter extends AbstractAdapter
2222
2323 public function __construct (CacheProvider $ provider , $ defaultLifetime = 0 , $ namespace = '' )
2424 {
25- parent ::__construct ($ namespace , $ defaultLifetime );
25+ parent ::__construct ('' , $ defaultLifetime );
2626 $ this ->provider = $ provider ;
27+ $ provider ->setNamespace ($ namespace );
2728 }
2829
2930 /**
@@ -47,7 +48,11 @@ protected function doHave($id)
4748 */
4849 protected function doClear ($ namespace )
4950 {
50- return $ this ->provider ->flushAll ();
51+ $ namespace = $ this ->provider ->getNamespace ();
52+
53+ return isset ($ namespace [0 ])
54+ ? $ this ->provider ->deleteAll ()
55+ : $ this ->provider ->flushAll ();
5156 }
5257
5358 /**
You can’t perform that action at this time.
0 commit comments