aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-09-07 13:16:50 +0200
committerBart Visscher <bartv@thisnet.nl>2012-09-07 13:42:22 +0200
commitff42da58b96999221e8ce0df555b8837ff67bb08 (patch)
treea60bd457c4f09a5c95e31068adeb4ebcdae29bdd
parent9ea7817a4074ba63a95bda9d0937e7ff01ac2e85 (diff)
downloadnextcloud-server-ff42da58b96999221e8ce0df555b8837ff67bb08.tar.gz
nextcloud-server-ff42da58b96999221e8ce0df555b8837ff67bb08.zip
Global file cache should also be able to clear with prefix
-rw-r--r--lib/cache/fileglobal.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cache/fileglobal.php b/lib/cache/fileglobal.php
index d4336553c38..e551ad472a2 100644
--- a/lib/cache/fileglobal.php
+++ b/lib/cache/fileglobal.php
@@ -64,12 +64,13 @@ class OC_Cache_FileGlobal{
return unlink($cache_dir.$key);
}
- public function clear(){
+ public function clear($prefix=''){
$cache_dir = self::getCacheDir();
+ $prefix = $this->fixKey($prefix);
if($cache_dir and is_dir($cache_dir)){
$dh=opendir($cache_dir);
while($file=readdir($dh)){
- if($file!='.' and $file!='..'){
+ if($file!='.' and $file!='..' and ($prefix==='' || strpos($file, $prefix) === 0)){
unlink($cache_dir.$file);
}
}