diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-09-30 16:11:01 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-09-30 16:11:01 +0200 |
commit | 113c339c41663c692eae809ada23c4057f9e3ff0 (patch) | |
tree | b745745c8a7bd6f288a95daca88003a00ea16ccc | |
parent | 258782584e490b92ccfcf032921aa7062a28da9f (diff) | |
download | nextcloud-server-113c339c41663c692eae809ada23c4057f9e3ff0.tar.gz nextcloud-server-113c339c41663c692eae809ada23c4057f9e3ff0.zip |
fix updating the filecache for when contents of a folder has changed
-rw-r--r-- | lib/filecache/update.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/filecache/update.php b/lib/filecache/update.php index 2b64a2a90ff..1b81f70d77b 100644 --- a/lib/filecache/update.php +++ b/lib/filecache/update.php @@ -81,10 +81,13 @@ class OC_FileCache_Update{ $dh=$view->opendir($path.'/'); if($dh) {//check for changed/new files while (($filename = readdir($dh)) !== false) { - if($filename != '.' and $filename != '..') { + if($filename != '.' and $filename != '..' and $filename != '') { $file=$path.'/'.$filename; - if(self::hasUpdated($file, $root)) { - if($root===false) {//filesystem hooks are only valid for the default root + $isDir=$view->is_dir($file); + if(self::hasUpdated($file, $root, $isDir)) { + if($isDir){ + self::updateFolder($file, $root); + }elseif($root===false) {//filesystem hooks are only valid for the default root OC_Hook::emit('OC_Filesystem', 'post_write', array('path'=>$file)); }else{ self::update($file, $root); @@ -136,7 +139,7 @@ class OC_FileCache_Update{ } /** - * update the filecache according to changes to the fileysystem + * update the filecache according to changes to the filesystem * @param string path * @param string root (optional) */ @@ -211,4 +214,4 @@ class OC_FileCache_Update{ OC_FileCache::increaseSize(dirname($newPath), $oldSize, $root); OC_FileCache::move($oldPath, $newPath); } -}
\ No newline at end of file +} |