| @@ 576-584 (lines=9) @@ | ||
| 573 | } else { |
|
| 574 | $total = $free; //either unknown or unlimited |
|
| 575 | } |
|
| 576 | if ($total > 0) { |
|
| 577 | if ($quota > 0 && $total > $quota) { |
|
| 578 | $total = $quota; |
|
| 579 | } |
|
| 580 | // prevent division by zero or error codes (negative values) |
|
| 581 | $relative = round(($used / $total) * 10000) / 100; |
|
| 582 | } else { |
|
| 583 | $relative = 0; |
|
| 584 | } |
|
| 585 | ||
| 586 | $ownerId = $storage->getOwner($path); |
|
| 587 | $ownerDisplayName = ''; |
|
| @@ 621-629 (lines=9) @@ | ||
| 618 | $total = $quota; |
|
| 619 | $free = $quota - $used; |
|
| 620 | ||
| 621 | if ($total > 0) { |
|
| 622 | if ($quota > 0 && $total > $quota) { |
|
| 623 | $total = $quota; |
|
| 624 | } |
|
| 625 | // prevent division by zero or error codes (negative values) |
|
| 626 | $relative = round(($used / $total) * 10000) / 100; |
|
| 627 | } else { |
|
| 628 | $relative = 0; |
|
| 629 | } |
|
| 630 | ||
| 631 | return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative); |
|
| 632 | ||