From d446eecd5e9ad98af34e6c7a88647f72f9e652cb Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 8 Aug 2013 09:44:19 +0200 Subject: [PATCH] oc_cache needs to disable file proxys for read/write operation. Otherwise the operation will go through the encryption app which will not work. --- lib/cache/file.php | 16 ++++++++++++---- 1 file 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) { -- 2.39.5