diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-07-22 02:31:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-07-22 02:31:48 +0200 |
commit | 51566e87c7343385ae3b6854386c20974c94a53d (patch) | |
tree | 35b50a0cf64ed280f037902a87504d2af3a92428 /lib/cache/file.php | |
parent | 2b747789588e34bce24bd558f7e979a6e0ea8047 (diff) | |
download | nextcloud-server-51566e87c7343385ae3b6854386c20974c94a53d.tar.gz nextcloud-server-51566e87c7343385ae3b6854386c20974c94a53d.zip |
add prefix option to OC_Cache::clear
Diffstat (limited to 'lib/cache/file.php')
-rw-r--r-- | lib/cache/file.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cache/file.php b/lib/cache/file.php index 0b7d3e30508..562c3d17167 100644 --- a/lib/cache/file.php +++ b/lib/cache/file.php @@ -62,15 +62,16 @@ class OC_Cache_File{ return $storage->unlink($key); } - public function clear(){ + public function clear($prefix=''){ $storage = $this->getStorage(); if($storage and $storage->is_dir('/')){ $dh=$storage->opendir('/'); while($file=readdir($dh)){ - if($file!='.' and $file!='..'){ + if($file!='.' and $file!='..' and ($prefix==='' || strpos($file, $prefix) === 0)){ $storage->unlink('/'.$file); } } } + return true; } } |