Fix OC_Helper and change deprecated methods

This commit is contained in:
Michael Gapczynski 2013-01-26 15:16:53 -05:00
parent 930b9b9cd0
commit 7237ebf08b
1 changed files with 3 additions and 3 deletions

View File

@ -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