diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-25 17:42:50 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-25 21:05:10 +0200 |
commit | 531c1c509c32d400f0eebfd436ac608a6b6e35a7 (patch) | |
tree | 101f7b6e23efd981110ce5a4f4fece72117846c1 /lib/cache.php | |
parent | 4e4a1a4274940a9aa7b4c9313d13f8aeb80123ba (diff) | |
download | nextcloud-server-531c1c509c32d400f0eebfd436ac608a6b6e35a7.tar.gz nextcloud-server-531c1c509c32d400f0eebfd436ac608a6b6e35a7.zip |
Cache: Add APC and XCache to global cache handler
Diffstat (limited to 'lib/cache.php')
-rw-r--r-- | lib/cache.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/cache.php b/lib/cache.php index e6f2beeb306..1f269174fad 100644 --- a/lib/cache.php +++ b/lib/cache.php @@ -12,7 +12,17 @@ class OC_Cache { static public function getGlobalCache() { if (!self::$global_cache) { + $fast_cache = null; + if (!$fast_cache && function_exists('xcache_set')) { + $fast_cache = new OC_Cache_XCache(true); + } + if (!$fast_cache && function_exists('apc_store')) { + $fast_cache = new OC_Cache_APC(true); + } self::$global_cache = new OC_Cache_FileGlobal(); + if ($fast_cache) { + self::$global_cache = new OC_Cache_Broker($fast_cache, self::$global_cache); + } } return self::$global_cache; } |