2013-01-18 23:31:09 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace OCA\files\lib;
|
|
|
|
|
|
|
|
class Helper
|
|
|
|
{
|
|
|
|
public static function buildFileStorageStatistics($dir) {
|
|
|
|
$l = new \OC_L10N('files');
|
|
|
|
$maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir);
|
|
|
|
$maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize);
|
|
|
|
$maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize;
|
|
|
|
|
|
|
|
// information about storage capacities
|
2013-08-26 22:59:58 +00:00
|
|
|
$storageInfo = \OC_Helper::getStorageInfo($dir);
|
2013-01-18 23:31:09 +00:00
|
|
|
|
|
|
|
return array('uploadMaxFilesize' => $maxUploadFilesize,
|
|
|
|
'maxHumanFilesize' => $maxHumanFilesize,
|
|
|
|
'usedSpacePercent' => (int)$storageInfo['relative']);
|
|
|
|
}
|
|
|
|
}
|