[Pkg-owncloud-commits] [owncloud] 41/118: Fix size propagation over shared storage boundary

David Prévot taffit at moszumanska.debian.org
Fri Mar 27 22:13:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 769f666663a743f6ad4bf2637c0b1eeb4937b623
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu Mar 5 22:23:47 2015 +0100

    Fix size propagation over shared storage boundary
---
 apps/files_sharing/lib/cache.php | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 21f807f..c56af6b 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -395,6 +395,28 @@ class Shared_Cache extends Cache {
 	}
 
 	/**
+	 * update the folder size and the size of all parent folders
+	 *
+	 * @param string|boolean $path
+	 * @param array $data (optional) meta data of the folder
+	 */
+	public function correctFolderSize($path, $data = null) {
+		$this->calculateFolderSize($path, $data);
+		if ($path !== '') {
+			$parent = dirname($path);
+			if ($parent === '.' or $parent === '/') {
+				$parent = '';
+			}
+			$this->correctFolderSize($parent);
+		} else {
+			// bubble up to source cache
+			$sourceCache = $this->getSourceCache($path);
+			$parent = dirname($this->files[$path]);
+			$sourceCache->correctFolderSize($parent);
+		}
+	}
+
+	/**
 	 * get the size of a folder and set it in the cache
 	 *
 	 * @param string $path

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list