Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-04-02 19:10:57 +0400
committerRobin Appelman <icewind@owncloud.com>2014-04-02 19:10:57 +0400
commitda5541ac025e5f5f9dbd7318b903266eedbed263 (patch)
tree124d77443579674234f9d48d86268d0f5205cbc6 /lib/private/helper.php
parent16d10844cd01dc89f864cda6bde5169812e89b62 (diff)
Allow reusing FileInfo for getStorageInfo
Diffstat (limited to 'lib/private/helper.php')
-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;
}