diff options
Diffstat (limited to 'lib/filecache.php')
-rw-r--r-- | lib/filecache.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/filecache.php b/lib/filecache.php index 07099bcccd5..305ba035fb5 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -488,6 +488,20 @@ class OC_FileCache{ $query->execute(); } } + + /** + * trigger an update for the cache by setting the mtimes to 0 + * @param string $user (optional) + */ + public static function triggerUpdate($user=''){ + if($user) { + $query=OC_DB::prepare('UPDATE `*PREFIX*fscache` SET `mtime`=0 WHERE `user`=? AND `mimetype`="httpd/unix-directory"'); + $query->execute(array($user)); + }else{ + $query=OC_DB::prepare('UPDATE `*PREFIX*fscache` SET `mtime`=0 AND `mimetype`="httpd/unix-directory"'); + $query->execute(); + } + } } //watch for changes and try to keep the cache up to date |