diff options
author | Stephan Peijnik <speijnik@anexia-it.com> | 2014-07-11 10:36:28 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-08-19 13:55:35 +0200 |
commit | 2df52e54d712a148f91c0945d95ffac2dc78802a (patch) | |
tree | eef3f86f5c0cd508c6ac2d1489fd056abd4cf920 /lib/private/files/storage | |
parent | fdfc5c67f8e90ac0a439579e9a64d1a643686bd3 (diff) | |
download | nextcloud-server-2df52e54d712a148f91c0945d95ffac2dc78802a.tar.gz nextcloud-server-2df52e54d712a148f91c0945d95ffac2dc78802a.zip |
Fix STORAGE_* constants usage by moving those constants into \OC\Files\Filesystem.
As constants not defined within a class cannot be automatically found by the
autoloader moving those constants into a class makes them accessible to
code which uses them.
Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com>
Diffstat (limited to 'lib/private/files/storage')
-rw-r--r-- | lib/private/files/storage/common.php | 2 | ||||
-rw-r--r-- | lib/private/files/storage/dav.php | 4 | ||||
-rw-r--r-- | lib/private/files/storage/local.php | 2 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/quota.php | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 0720b8180c9..08c892cb7fe 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -398,7 +398,7 @@ abstract class Common implements \OC\Files\Storage\Storage { * @return int */ public function free_space($path) { - return \OC\Files\SPACE_UNKNOWN; + return \OC\Files\Filesystem::SPACE_UNKNOWN; } /** diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php index ce447417d20..93036b8ca44 100644 --- a/lib/private/files/storage/dav.php +++ b/lib/private/files/storage/dav.php @@ -243,10 +243,10 @@ class DAV extends \OC\Files\Storage\Common { if (isset($response['{DAV:}quota-available-bytes'])) { return (int)$response['{DAV:}quota-available-bytes']; } else { - return \OC\Files\SPACE_UNKNOWN; + return \OC\Files\Filesystem::SPACE_UNKNOWN; } } catch (\Exception $e) { - return \OC\Files\SPACE_UNKNOWN; + return \OC\Files\Filesystem::SPACE_UNKNOWN; } } diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php index a8b420e978a..eeb7af5cd08 100644 --- a/lib/private/files/storage/local.php +++ b/lib/private/files/storage/local.php @@ -218,7 +218,7 @@ if (\OC_Util::runningOnWindows()) { public function free_space($path) { $space = @disk_free_space($this->datadir . $path); if ($space === false || is_null($space)) { - return \OC\Files\SPACE_UNKNOWN; + return \OC\Files\Filesystem::SPACE_UNKNOWN; } return $space; } diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php index c57c797f87a..f9157ba84f4 100644 --- a/lib/private/files/storage/wrapper/quota.php +++ b/lib/private/files/storage/wrapper/quota.php @@ -50,7 +50,7 @@ class Quota extends Wrapper { } return $data['size']; } else { - return \OC\Files\SPACE_NOT_COMPUTED; + return \OC\Files\Filesystem::SPACE_NOT_COMPUTED; } } @@ -66,7 +66,7 @@ class Quota extends Wrapper { } else { $used = $this->getSize($this->sizeRoot); if ($used < 0) { - return \OC\Files\SPACE_NOT_COMPUTED; + return \OC\Files\Filesystem::SPACE_NOT_COMPUTED; } else { $free = $this->storage->free_space($path); $quotaFree = max($this->quota - $used, 0); |