summaryrefslogtreecommitdiffstats
path: root/lib/filecache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-09-06 23:10:24 +0200
committerRobin Appelman <icewind@owncloud.com>2012-09-06 23:10:33 +0200
commit2144b2f37ae90faa03a44e5526c29893c5c7e7d0 (patch)
tree110aa1cb5df0a159ba42001468e31d633def8e84 /lib/filecache.php
parent39577495e122a9d94507f99c6b3f9f3430735c13 (diff)
downloadnextcloud-server-2144b2f37ae90faa03a44e5526c29893c5c7e7d0.tar.gz
nextcloud-server-2144b2f37ae90faa03a44e5526c29893c5c7e7d0.zip
clear the filecache if the mount configuration has changed
Diffstat (limited to 'lib/filecache.php')
-rw-r--r--lib/filecache.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/filecache.php b/lib/filecache.php
index 811e8a3e6a2..de38ad99e8e 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -474,6 +474,20 @@ class OC_FileCache{
$query=OC_DB::prepare('DELETE FROM `*PREFIX*fscache` WHERE LENGTH(`path_hash`)<30');
$query->execute();
}
+
+ /**
+ * clear filecache entries
+ * @param string user (optonal)
+ */
+ public static function clear($user=''){
+ if($user){
+ $query=OC_DB::prepare('DELETE FROM `*PREFIX*fscache` WHERE user=?');
+ $query->execute(array($user));
+ }else{
+ $query=OC_DB::prepare('DELETE FROM `*PREFIX*fscache`');
+ $query->execute();
+ }
+ }
}
//watch for changes and try to keep the cache up to date