diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-02-20 16:47:59 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-02-20 16:47:59 +0100 |
commit | ec45a3c0e2567c89729bc6fe8c996b7939025429 (patch) | |
tree | 5ef1506bd10ed4b01b6cf5acf939dd1f53751237 /lib | |
parent | bfe6dfe5daeb42723032c7ca2e526ff51326df4e (diff) | |
parent | e6df86f4cb4b28c07804cb5748cf3d0679e58b25 (diff) | |
download | nextcloud-server-ec45a3c0e2567c89729bc6fe8c996b7939025429.tar.gz nextcloud-server-ec45a3c0e2567c89729bc6fe8c996b7939025429.zip |
Merge pull request #6962 from owncloud/quota-space-root
Allow passing a root folder to get the used space from in the quota wrapper
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/storage/wrapper/quota.php | 8 | ||||
-rw-r--r-- | lib/private/image.php | 2 | ||||
-rwxr-xr-x | lib/private/util.php | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php index 1bcdca7f47a..26c952e694a 100644 --- a/lib/private/files/storage/wrapper/quota.php +++ b/lib/private/files/storage/wrapper/quota.php @@ -16,11 +16,17 @@ class Quota extends Wrapper { protected $quota; /** + * @var string $sizeRoot + */ + protected $sizeRoot; + + /** * @param array $parameters */ public function __construct($parameters) { $this->storage = $parameters['storage']; $this->quota = $parameters['quota']; + $this->sizeRoot = isset($parameters['root']) ? $parameters['root'] : ''; } /** @@ -46,7 +52,7 @@ class Quota extends Wrapper { if ($this->quota < 0) { return $this->storage->free_space($path); } else { - $used = $this->getSize(''); + $used = $this->getSize($this->sizeRoot); if ($used < 0) { return \OC\Files\SPACE_NOT_COMPUTED; } else { diff --git a/lib/private/image.php b/lib/private/image.php index 42685ddab5c..17caaa012f5 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -231,7 +231,7 @@ class OC_Image { } /** - * @returns Returns the image resource in any. + * @returns resource Returns the image resource in any. */ public function resource() { return $this->resource; diff --git a/lib/private/util.php b/lib/private/util.php index b7856436527..d3b682daa5c 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -65,7 +65,7 @@ class OC_Util { $user = $storage->getUser()->getUID(); $quota = OC_Util::getUserQuota($user); if ($quota !== \OC\Files\SPACE_UNLIMITED) { - return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota)); + return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files')); } } |