summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-09-05 13:23:10 +0200
committerRobin Appelman <icewind@owncloud.com>2014-09-05 13:23:10 +0200
commita1f4a0601bba05920d1f62f683a085daed65dde3 (patch)
tree88ca111f22d9d1f136269c9d21979d176b61c520 /apps/files_external
parent3d7aff84e53ab344855a83b2162527d0baae954a (diff)
downloadnextcloud-server-a1f4a0601bba05920d1f62f683a085daed65dde3.tar.gz
nextcloud-server-a1f4a0601bba05920d1f62f683a085daed65dde3.zip
Fix hasUpdated for folders in swift backend
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/swift.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index 32c7dd57afb..1c56d180e2f 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -509,6 +509,28 @@ class Swift extends \OC\Files\Storage\Common {
unlink($tmpFile);
}
+ public function hasUpdated($path, $time) {
+ if ($this->is_file($path)) {
+ return parent::hasUpdated($path, $time);
+ }
+ $path = $this->normalizePath($path);
+ $dh = $this->opendir($path);
+ $content = array();
+ while (($file = readdir($dh)) !== false) {
+ $content[] = $file;
+ }
+ if ($path === '.') {
+ $path = '';
+ }
+ $cachedContent = $this->getCache()->getFolderContents($path);
+ $cachedNames = array_map(function ($content) {
+ return $content['name'];
+ }, $cachedContent);
+ sort($cachedNames);
+ sort($content);
+ return $cachedNames != $content;
+ }
+
/**
* check if curl is installed
*/