summaryrefslogtreecommitdiffstats
path: root/lib/private/cache/file.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-10-15 11:53:51 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-10-15 11:53:51 +0200
commit25320f19df017947f31ea156ade061274b5bd691 (patch)
tree6096ab2633d0b58f594fb5e600638603d85acdc9 /lib/private/cache/file.php
parent0b8273c76834783461bc186cca69e1a73f2570de (diff)
parent52501d6ba3da5596975a945ba00ea753f6c7f4e7 (diff)
downloadnextcloud-server-25320f19df017947f31ea156ade061274b5bd691.tar.gz
nextcloud-server-25320f19df017947f31ea156ade061274b5bd691.zip
Merge branch 'master' into avater_with_encryption
Diffstat (limited to 'lib/private/cache/file.php')
-rw-r--r--lib/private/cache/file.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php
index 2ab914d17b8..b0738d2a92b 100644
--- a/lib/private/cache/file.php
+++ b/lib/private/cache/file.php
@@ -41,6 +41,24 @@ class File {
return $result;
}
+ /**
+ * Returns the size of the stored/cached data
+ *
+ * @param $key
+ * @return int
+ */
+ public function size($key) {
+ $result = 0;
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
+ if ($this->hasKey($key)) {
+ $storage = $this->getStorage();
+ $result = $storage->filesize($key);
+ }
+ \OC_FileProxy::$enabled = $proxyStatus;
+ return $result;
+ }
+
public function set($key, $value, $ttl=0) {
$storage = $this->getStorage();
$result = false;