From e2f6aa3a57c641c4fe4bebea9497f3801d7d74bc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 14 Apr 2016 15:41:04 +0200 Subject: factor out redis configuration into it's own factory --- lib/private/Server.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/private/Server.php') diff --git a/lib/private/Server.php b/lib/private/Server.php index bbe6b88876f..f8e7ecfbe14 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -312,6 +312,10 @@ class Server extends ServerContainer implements IServerContainer { '\\OC\\Memcache\\ArrayCache' ); }); + $this->registerService('RedisFactory', function (Server $c) { + $systemConfig = $c->getSystemConfig(); + return new RedisFactory($systemConfig); + }); $this->registerService('ActivityManager', function (Server $c) { return new \OC\Activity\Manager( $c->getRequest(), @@ -905,6 +909,16 @@ class Server extends ServerContainer implements IServerContainer { return $this->query('MemCacheFactory'); } + /** + * Returns an \OC\RedisFactory instance + * + * @return \OC\RedisFactory + */ + public function getGetRedisFactory() { + return $this->query('RedisFactory'); + } + + /** * Returns the current session * -- cgit v1.2.3