diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-01-29 16:33:27 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-01-29 16:33:27 +0100 |
commit | 4e2b52a376d2aab5e0f9d0034a8e2bfa196c08bd (patch) | |
tree | 78094fbe60703eae8e4eb1d5d7a42d249a515f21 /lib/private/files | |
parent | fc5f20112efe03b203978c4b1045ed70c2ce5e74 (diff) | |
parent | f5f918b8bf5279fd174fe520c21f83c902904843 (diff) | |
download | nextcloud-server-4e2b52a376d2aab5e0f9d0034a8e2bfa196c08bd.tar.gz nextcloud-server-4e2b52a376d2aab5e0f9d0034a8e2bfa196c08bd.zip |
merge master into fileinfo
Diffstat (limited to 'lib/private/files')
-rw-r--r-- | lib/private/files/cache/watcher.php | 4 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/quota.php | 2 | ||||
-rw-r--r-- | lib/private/files/view.php | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/files/cache/watcher.php b/lib/private/files/cache/watcher.php index 58f624c8990..251ecbe7071 100644 --- a/lib/private/files/cache/watcher.php +++ b/lib/private/files/cache/watcher.php @@ -40,7 +40,7 @@ class Watcher { * check $path for updates * * @param string $path - * @return boolean true if path was updated, false otherwise + * @return boolean | array true if path was updated, otherwise the cached data is returned */ public function checkUpdate($path) { $cachedEntry = $this->cache->get($path); @@ -56,7 +56,7 @@ class Watcher { $this->cache->correctFolderSize($path); return true; } - return false; + return $cachedEntry; } /** diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php index 43016e0892f..a430e3e4617 100644 --- a/lib/private/files/storage/wrapper/quota.php +++ b/lib/private/files/storage/wrapper/quota.php @@ -95,7 +95,7 @@ class Quota extends Wrapper { public function fopen($path, $mode) { $source = $this->storage->fopen($path, $mode); $free = $this->free_space(''); - if ($free >= 0 && $mode !== 'r') { + if ($source && $free >= 0 && $mode !== 'r' && $mode !== 'rb') { return \OC\Files\Stream\Quota::wrap($source, $free); } else { return $source; diff --git a/lib/private/files/view.php b/lib/private/files/view.php index b5870279664..6fc534757b2 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -794,6 +794,7 @@ class View { * @var string $internalPath */ list($storage, $internalPath) = Filesystem::resolvePath($path); + $data = null; if ($storage) { $cache = $storage->getCache($internalPath); $permissionsCache = $storage->getPermissionsCache($internalPath); @@ -804,10 +805,12 @@ class View { $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW); } else { $watcher = $storage->getWatcher($internalPath); - $watcher->checkUpdate($internalPath); + $data = $watcher->checkUpdate($internalPath); } - $data = $cache->get($internalPath); + if (!is_array($data)) { + $data = $cache->get($internalPath); + } if ($data and $data['fileid']) { if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') { |