diff options
author | kondou <kondou@ts.unde.re> | 2013-08-09 18:02:40 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-09 18:02:40 +0200 |
commit | 80e9744da0045f562bebb14e838d464395760cdc (patch) | |
tree | 707a44cc36013e532b34eb33ce28fd5704504bd0 /lib/cache | |
parent | 605050df9b42ba68b2d8c34a4075a5af4ebd312c (diff) | |
parent | 98f836363a1aee8dbc767068fcb357802f228cf2 (diff) | |
download | nextcloud-server-80e9744da0045f562bebb14e838d464395760cdc.tar.gz nextcloud-server-80e9744da0045f562bebb14e838d464395760cdc.zip |
Merge branch 'master' into improve_app-management
Diffstat (limited to 'lib/cache')
-rw-r--r-- | lib/cache/file.php | 16 |
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) { |