Blame view

sources/apps/files/lib/helper.php 601 Bytes
03e52840d   Kload   Init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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($dir);
  
  		return array('uploadMaxFilesize' => $maxUploadFilesize,
  					 'maxHumanFilesize'  => $maxHumanFilesize,
  					 'usedSpacePercent'  => (int)$storageInfo['relative']);
  	}
  }