diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-18 17:29:30 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-19 09:47:36 +0100 |
commit | 9ccaf85078da4efa28e5d4a7315459b1c8c68e9e (patch) | |
tree | 15d4979840cc46702a6b8c23582cc8e704a2d67a /lib/files | |
parent | fbf1b127db2421b47874ee49be89d9dbaa6c2dda (diff) | |
download | nextcloud-server-9ccaf85078da4efa28e5d4a7315459b1c8c68e9e.tar.gz nextcloud-server-9ccaf85078da4efa28e5d4a7315459b1c8c68e9e.zip |
External storage space is now not counted in total space
Added argument to getFileInfo() to disable adding the size of
mountpoints to a directory's size.
Backport of 614e4d485c8b74f6879c401f8cbb93e9335bf9b3
Diffstat (limited to 'lib/files')
-rw-r--r-- | lib/files/filesystem.php | 6 | ||||
-rw-r--r-- | lib/files/view.php | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 1850d50f971..95bdd100cbf 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -624,6 +624,8 @@ class Filesystem { * get the filesystem info * * @param string $path + * @param boolean $includeMountPoints whether to add mountpoint sizes, + * defaults to true * @return array * * returns an associative array with the following keys: @@ -633,8 +635,8 @@ class Filesystem { * - encrypted * - versioned */ - public static function getFileInfo($path) { - return self::$defaultInstance->getFileInfo($path); + public static function getFileInfo($path, $includeMountPoints = true) { + return self::$defaultInstance->getFileInfo($path, $includeMountPoints); } /** diff --git a/lib/files/view.php b/lib/files/view.php index f02e3d4d513..fd408fecfd7 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -750,6 +750,8 @@ class View { * get the filesystem info * * @param string $path + * @param boolean $includeMountPoints whether to add mountpoint sizes, + * defaults to true * @return array * * returns an associative array with the following keys: @@ -759,7 +761,7 @@ class View { * - encrypted * - versioned */ - public function getFileInfo($path) { + public function getFileInfo($path, $includeMountPoints = true) { $data = array(); if (!Filesystem::isValidPath($path)) { return $data; @@ -786,7 +788,7 @@ class View { $data = $cache->get($internalPath); if ($data and $data['fileid']) { - if ($data['mimetype'] === 'httpd/unix-directory') { + if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') { //add the sizes of other mountpoints to the folder $mountPoints = Filesystem::getMountPoints($path); foreach ($mountPoints as $mountPoint) { |