| @@ 323-327 (lines=5) @@ | ||
| 320 | * The OC_Util methods require a view. This just uses the node API |
|
| 321 | */ |
|
| 322 | $freeSpace = $share->getNode()->getStorage()->free_space($share->getNode()->getInternalPath()); |
|
| 323 | if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) { |
|
| 324 | $freeSpace = max($freeSpace, 0); |
|
| 325 | } else { |
|
| 326 | $freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
| 327 | } |
|
| 328 | ||
| 329 | $uploadLimit = Util::uploadLimit(); |
|
| 330 | $maxUploadFilesize = min($freeSpace, $uploadLimit); |
|
| @@ 472-477 (lines=6) @@ | ||
| 469 | */ |
|
| 470 | public static function freeSpace($dir) { |
|
| 471 | $freeSpace = \OC\Files\Filesystem::free_space($dir); |
|
| 472 | if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) { |
|
| 473 | $freeSpace = max($freeSpace, 0); |
|
| 474 | return $freeSpace; |
|
| 475 | } else { |
|
| 476 | return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
| 477 | } |
|
| 478 | } |
|
| 479 | ||
| 480 | /** |
|