Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/cache
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-25 19:42:50 +0400
committerBart Visscher <bartv@thisnet.nl>2012-06-25 23:05:10 +0400
commit531c1c509c32d400f0eebfd436ac608a6b6e35a7 (patch)
tree101f7b6e23efd981110ce5a4f4fece72117846c1 /lib/cache
parent4e4a1a4274940a9aa7b4c9313d13f8aeb80123ba (diff)
Cache: Add APC and XCache to global cache handler
Diffstat (limited to 'lib/cache')
-rw-r--r--lib/cache/apc.php11
-rw-r--r--lib/cache/xcache.php11
2 files changed, 20 insertions, 2 deletions
diff --git a/lib/cache/apc.php b/lib/cache/apc.php
index b1ce87f5267..6cf47d0c158 100644
--- a/lib/cache/apc.php
+++ b/lib/cache/apc.php
@@ -7,11 +7,20 @@
*/
class OC_Cache_APC {
+ protected $prefix;
+
+ public function __construct($global = false) {
+ $this->prefix = OC_Util::getInstanceId().'/';
+ if (!$global) {
+ $this->prefix .= OC_User::getUser().'/';
+ }
+ }
+
/**
* entries in APC gets namespaced to prevent collisions between owncloud instances and users
*/
protected function getNameSpace() {
- return OC_Util::getInstanceId().'/'.OC_User::getUser().'/';
+ return $this->prefix;
}
public function get($key) {
diff --git a/lib/cache/xcache.php b/lib/cache/xcache.php
index b57338929e0..bd55cee8f6b 100644
--- a/lib/cache/xcache.php
+++ b/lib/cache/xcache.php
@@ -7,11 +7,20 @@
*/
class OC_Cache_XCache {
+ protected $prefix;
+
+ public function __construct($global = false) {
+ $this->prefix = OC_Util::getInstanceId().'/';
+ if (!$global) {
+ $this->prefix .= OC_User::getUser().'/';
+ }
+ }
+
/**
* entries in XCache gets namespaced to prevent collisions between owncloud instances and users
*/
protected function getNameSpace() {
- return OC_Util::getInstanceId().'/'.OC_User::getUser().'/';
+ return $this->prefix;
}
public function get($key) {