|
|
|
@ -841,15 +841,18 @@ class OC_Helper { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Calculate the disc space |
|
|
|
|
* Calculate the disc space for the given path |
|
|
|
|
* |
|
|
|
|
* @param string $path |
|
|
|
|
* @return array |
|
|
|
|
*/ |
|
|
|
|
public static function getStorageInfo() { |
|
|
|
|
$rootInfo = \OC\Files\Filesystem::getFileInfo('/'); |
|
|
|
|
public static function getStorageInfo($path) { |
|
|
|
|
$rootInfo = \OC\Files\Filesystem::getFileInfo($path); |
|
|
|
|
$used = $rootInfo['size']; |
|
|
|
|
if ($used < 0) { |
|
|
|
|
$used = 0; |
|
|
|
|
} |
|
|
|
|
$free = \OC\Files\Filesystem::free_space(); |
|
|
|
|
$free = \OC\Files\Filesystem::free_space($path); |
|
|
|
|
if ($free >= 0) { |
|
|
|
|
$total = $free + $used; |
|
|
|
|
} else { |
|
|
|
|