Fix OC_Helper and change deprecated methods

remotes/origin/stable5
Michael Gapczynski 12 years ago
parent 930b9b9cd0
commit 7237ebf08b
  1. 6
      lib/helper.php

@ -760,7 +760,7 @@ class OC_Helper {
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace = OC_Filesystem::free_space($dir);
$freeSpace = \OC\Files\Filesystem::free_space($dir);
$freeSpace = max($freeSpace, 0);
return min($maxUploadFilesize, $freeSpace);
@ -790,12 +790,12 @@ class OC_Helper {
* Calculate the disc space
*/
public static function getStorageInfo() {
$rootInfo = OC_FileCache::get('');
$rootInfo = \OC\Files\Filesystem::getFileInfo('/');
$used = $rootInfo['size'];
if ($used < 0) {
$used = 0;
}
$free = OC_Filesystem::free_space();
$free = \OC\Files\Filesystem::free_space();
$total = $free + $used;
if ($total == 0) {
$total = 1; // prevent division by zero

Loading…
Cancel
Save