| 1 | <?php |
||
| 18 | class UtilFactory { |
||
| 19 | /** |
||
| 20 | * calculates the maximum upload size respecting system settings, free space |
||
| 21 | * and user quota |
||
| 22 | * |
||
| 23 | * @param string $dir the current folder where the user currently operates |
||
| 24 | * @param int $free the number of bytes free on the storage holding $dir, |
||
| 25 | * if not set this will be received from the storage directly |
||
| 26 | * @return int number of bytes representing |
||
| 27 | */ |
||
| 28 | public function maxUploadFilesize($dir, $free = null) { |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Make a human file size (2048 to 2 kB) |
||
| 34 | * @param int $bytes file size in bytes |
||
| 35 | * @return string a human readable file size |
||
| 36 | */ |
||
| 37 | public function humanFileSize($bytes) { |
||
| 40 | } |
||
| 41 |