[Pkg-owncloud-commits] [owncloud] 10/78: Fix size propagation over shared storage boundary
David Prévot
taffit at moszumanska.debian.org
Sun May 31 01:59:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit a529b2bf8699fba0f4ca15a954b59db2efbeafb4
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 c1ef503..57e09c9 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -346,6 +346,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