summaryrefslogtreecommitdiffstats
path: root/lib/private/cache/file.php
diff options
context:
space:
mode:
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;