This repository was archived by the owner on Nov 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,15 @@ public function setNamespace($namespace) {
77
77
}
78
78
}
79
79
80
+ /**
81
+ * @return mixed
82
+ */
83
+ public function allProvidersSupportPatternDeletion (){
84
+ return array_reduce ($ this ->cacheProviders , function ($ carry , $ item ){
85
+ return $ carry && $ item instanceof PatternClearableCache;
86
+ }, true );
87
+ }
88
+
80
89
/**
81
90
* @return bool
82
91
*/
Original file line number Diff line number Diff line change @@ -312,7 +312,11 @@ public function deleteAll($namespace){
312
312
public function supportsPatternDelete ($ namespace )
313
313
{
314
314
$ cacheDriver = $ this ->getCacheDriver ($ namespace );
315
- return $ cacheDriver instanceof PatternClearableCache;
315
+ if ($ cacheDriver instanceof PydioChainCache){
316
+ return $ cacheDriver ->allProvidersSupportPatternDeletion ();
317
+ }else {
318
+ return $ cacheDriver instanceof PatternClearableCache;
319
+ }
316
320
}
317
321
318
322
/**
@@ -322,13 +326,13 @@ public function supportsPatternDelete($namespace)
322
326
*/
323
327
public function deleteKeyStartingWith ($ namespace , $ id ){
324
328
329
+ /** @var PatternClearableCache $cacheDriver */
325
330
$ cacheDriver = $ this ->getCacheDriver ($ namespace );
326
331
if ($ this ->requiresHttpForwarding ($ cacheDriver )){
327
332
$ this ->httpDeletion [$ namespace .$ id .'pattern ' ] = ["namespace " =>$ namespace , "pattern " => $ id ];
328
333
return true ;
329
334
}
330
-
331
- if (!($ cacheDriver instanceof PatternClearableCache)){
335
+ if (!$ this ->supportsPatternDelete ($ namespace )){
332
336
return false ;
333
337
}
334
338
Logger::debug ("CacheDriver::Http " , "Clear Pattern " .$ id , ["namespace " => $ namespace ]);
You can’t perform that action at this time.
0 commit comments