diff options
author | Henrik Kjölhede <hkjolhede@gmail.com> | 2013-01-26 21:51:18 +0100 |
---|---|---|
committer | Henrik Kjölhede <hkjolhede@gmail.com> | 2013-01-26 21:51:18 +0100 |
commit | b1b2eafa50db54b2613cf2bc52bfab2015d67b2f (patch) | |
tree | 68992916824e3bdd4c6ba9ab5af955420bfd8123 /apps/files/lib/helper.php | |
parent | a26d50640fc4a2524255c85b10fb010676b3e22d (diff) | |
parent | c9e25d3fab17b178759dd6d2f9488aa4cf37fbbb (diff) | |
download | nextcloud-server-b1b2eafa50db54b2613cf2bc52bfab2015d67b2f.tar.gz nextcloud-server-b1b2eafa50db54b2613cf2bc52bfab2015d67b2f.zip |
Merge remote-tracking branch 'upstream/master'
Conflicts:
apps/files_external/lib/config.php
Diffstat (limited to 'apps/files/lib/helper.php')
-rw-r--r-- | apps/files/lib/helper.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php new file mode 100644 index 00000000000..f2b1f142e9b --- /dev/null +++ b/apps/files/lib/helper.php @@ -0,0 +1,20 @@ +<?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 + $storageInfo = \OC_Helper::getStorageInfo(); + + return array('uploadMaxFilesize' => $maxUploadFilesize, + 'maxHumanFilesize' => $maxHumanFilesize, + 'usedSpacePercent' => (int)$storageInfo['relative']); + } +} |