summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-18 17:29:30 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-18 18:09:01 +0100
commit614e4d485c8b74f6879c401f8cbb93e9335bf9b3 (patch)
tree7b30c6fe4da0b984525aec5e938e40cf6406a059 /lib/private/files
parent44c2f9aad2b475303b3bebb39f38954cb3210751 (diff)
downloadnextcloud-server-614e4d485c8b74f6879c401f8cbb93e9335bf9b3.tar.gz
nextcloud-server-614e4d485c8b74f6879c401f8cbb93e9335bf9b3.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. Fixes #5924
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/filesystem.php6
-rw-r--r--lib/private/files/view.php6
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 8500b3c581b..a83e9aa86d2 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -725,6 +725,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:
@@ -734,8 +736,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/private/files/view.php b/lib/private/files/view.php
index c0b9f0fc9c8..8cb56ede91b 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -762,6 +762,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:
@@ -771,7 +773,7 @@ class View {
* - encrypted
* - versioned
*/
- public function getFileInfo($path) {
+ public function getFileInfo($path, $includeMountPoints = true) {
$data = array();
if (!Filesystem::isValidPath($path)) {
return $data;
@@ -798,7 +800,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) {