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
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-06 23:58:36 +0400
committerBart Visscher <bartv@thisnet.nl>2012-06-07 00:41:36 +0400
commit8dba47d466d3c5f411c4abe42f292c277cf8267f (patch)
tree4e451e50284c7f4ee4357973d21c315796ab8abc /lib/cache.php
parenta90089c79200c4665e28acb07215f08c2039c1a1 (diff)
Add layer to select fast or slow cache for storing values
Diffstat (limited to 'lib/cache.php')
-rw-r--r--lib/cache.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/cache.php b/lib/cache.php
index 70f11f35518..55d5b064c41 100644
--- a/lib/cache.php
+++ b/lib/cache.php
@@ -10,7 +10,17 @@ class OC_Cache {
static protected $cache;
static protected function init() {
+ $fast_cache = null;
+ if (!$fast_cache && function_exists('xcache_set')) {
+ $fast_cache = new OC_Cache_XCache();
+ }
+ if (!$fast_cache && function_exists('apc_store')) {
+ $fast_cache = new OC_Cache_APC();
+ }
self::$cache = new OC_Cache_File();
+ if ($fast_cache) {
+ self::$cache = new OC_Cache_Broker($fast_cache, self::$cache);
+ }
}
static public function get($key) {