diff options
author | icewind1991 <robin@icewind.nl> | 2014-06-27 19:31:18 +0200 |
---|---|---|
committer | icewind1991 <robin@icewind.nl> | 2014-06-27 19:31:18 +0200 |
commit | 1a3e698294b4a78aa437ad1aaebc7553fca1589d (patch) | |
tree | 9345c07cb5ec36152d98746854ceb5bbd51d0c4a /apps | |
parent | 7a1b45c43bcca2de24ef1cc55dd1867b63e1462e (diff) | |
parent | 1bb1504d2452ccf1fde24700d11dd105805d762d (diff) | |
download | nextcloud-server-1a3e698294b4a78aa437ad1aaebc7553fca1589d.tar.gz nextcloud-server-1a3e698294b4a78aa437ad1aaebc7553fca1589d.zip |
Merge pull request #9263 from owncloud/remote-share-update
Better detecting of remote changes for external shares
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/external/storage.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php index 2771f974614..454196f15ae 100644 --- a/apps/files_sharing/lib/external/storage.php +++ b/apps/files_sharing/lib/external/storage.php @@ -33,6 +33,8 @@ class Storage extends DAV implements ISharedStorage { */ private $token; + private $updateChecked = false; + public function __construct($options) { $this->remote = $options['remote']; $this->remoteUser = $options['owner']; @@ -100,4 +102,21 @@ class Storage extends DAV implements ISharedStorage { } return $this->scanner; } + + /** + * check if a file or folder has been updated since $time + * + * @param string $path + * @param int $time + * @return bool + */ + public function hasUpdated($path, $time) { + // since for owncloud webdav servers we can rely on etag propagation we only need to check the root of the storage + // because of that we only do one check for the entire storage per request + if ($this->updateChecked) { + return false; + } + $this->updateChecked = true; + return parent::hasUpdated('', $time); + } } |