summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-04-04 10:18:02 +0200
committerVincent Petry <pvince81@owncloud.com>2014-04-04 10:18:02 +0200
commit8a10c44eb33d45e2deba7d72b30e509fa332fb24 (patch)
tree0c874e8d186c4afd62a819b39fd0ff5e7ee4bc1b /lib
parent0805f678ccfc808d788611aabc486f8dcef054e5 (diff)
parentda5541ac025e5f5f9dbd7318b903266eedbed263 (diff)
downloadnextcloud-server-8a10c44eb33d45e2deba7d72b30e509fa332fb24.tar.gz
nextcloud-server-8a10c44eb33d45e2deba7d72b30e509fa332fb24.zip
Merge pull request #8015 from owncloud/storageinfo-reuse
Allow reusing FileInfo for getStorageInfo
Diffstat (limited to 'lib')
-rw-r--r--lib/private/helper.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index d7ac0b5f4fa..da3d3cd1c6e 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -875,12 +875,15 @@ class OC_Helper {
* Calculate the disc space for the given path
*
* @param string $path
+ * @param \OCP\Files\FileInfo $rootInfo (optional)
* @return array
*/
- public static function getStorageInfo($path) {
+ public static function getStorageInfo($path, $rootInfo = null) {
// return storage info without adding mount points
- $rootInfo = \OC\Files\Filesystem::getFileInfo($path, false);
- $used = $rootInfo['size'];
+ if (is_null($rootInfo)) {
+ $rootInfo = \OC\Files\Filesystem::getFileInfo($path, false);
+ }
+ $used = $rootInfo->getSize();
if ($used < 0) {
$used = 0;
}