From 1df1b55b66f0bcc696a1ee9aeb8362dee9889100 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 6 Jan 2014 12:55:56 +0100 Subject: [PATCH] expose memory cache in public api --- lib/private/server.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/private/server.php b/lib/private/server.php index bee70dec2d..84ee8cadf0 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -136,6 +136,10 @@ class Server extends SimpleContainer implements IServerContainer { $this->registerService('UserCache', function($c) { return new UserCache(); }); + $this->registerService('MemCache', function ($c) { + $factory = new \OC\Memcache\Factory(); + return $factory->create(); + }); $this->registerService('ActivityManager', function($c) { return new ActivityManager(); }); @@ -295,6 +299,15 @@ class Server extends SimpleContainer implements IServerContainer { return $this->query('UserCache'); } + /** + * Returns an ICache instance + * + * @return \OCP\ICache + */ + function getMemCache() { + return $this->query('MemCache'); + } + /** * Returns the current session *