adding size() to the file cache
This commit is contained in:
parent
46f59b165e
commit
0fb719dffe
1 changed files with 18 additions and 0 deletions
18
lib/cache/file.php
vendored
18
lib/cache/file.php
vendored
|
@ -40,6 +40,24 @@ class OC_Cache_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;
|
||||
|
|
Loading…
Reference in a new issue