summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2013-08-08 08:19:14 -0700
committerBjörn Schießle <bjoern@schiessle.org>2013-08-08 08:19:14 -0700
commitc24bf47db8966a08bff8d6972b7e06894f4a0391 (patch)
treed214c12bbab9a64feb58b84ddf92c28c14b065ec
parent062769ab6144c4b19cc5de41bbace4a6be0cb9b1 (diff)
parentab6e47b44adf7bbcfac232af22ec66283cbbd017 (diff)
downloadnextcloud-server-c24bf47db8966a08bff8d6972b7e06894f4a0391.tar.gz
nextcloud-server-c24bf47db8966a08bff8d6972b7e06894f4a0391.zip
Merge pull request #4349 from owncloud/oc_cache_fix
oc_cache needs to disable file proxys for read/write operation.
-rw-r--r--lib/cache/file.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/cache/file.php b/lib/cache/file.php
index 531e1d50f40..ba3dedaf8f3 100644
--- a/lib/cache/file.php
+++ b/lib/cache/file.php
@@ -29,22 +29,30 @@ class OC_Cache_File{
}
public function get($key) {
+ $result = null;
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
if ($this->hasKey($key)) {
$storage = $this->getStorage();
- return $storage->file_get_contents($key);
+ $result = $storage->file_get_contents($key);
}
- return null;
+ \OC_FileProxy::$enabled = $proxyStatus;
+ return $result;
}
public function set($key, $value, $ttl=0) {
$storage = $this->getStorage();
+ $result = false;
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
if ($storage and $storage->file_put_contents($key, $value)) {
if ($ttl === 0) {
$ttl = 86400; // 60*60*24
}
- return $storage->touch($key, time() + $ttl);
+ $result = $storage->touch($key, time() + $ttl);
}
- return false;
+ \OC_FileProxy::$enabled = $proxyStatus;
+ return $result;
}
public function hasKey($key) {