From d50c7391d8e78c9555b073fb9ccc6a91d5da34bc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 9 Jan 2014 13:54:50 +0100 Subject: [PATCH] Use $server->getMemCacheFactory() in ldap connection --- apps/user_ldap/lib/connection.php | 2 +- lib/public/cachefactory.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 14dfaa1174..92168a09ff 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -51,7 +51,7 @@ class Connection extends LDAPUtility { $this->configPrefix = $configPrefix; $this->configID = $configID; $this->configuration = new Configuration($configPrefix); - $memcache = new \OC\Memcache\Factory(); + $memcache = \OC::$server->getMemCacheFactory(); if($memcache->isAvailable()) { $this->cache = $memcache->create(); } else { diff --git a/lib/public/cachefactory.php b/lib/public/cachefactory.php index bb49aea7f3..1bb0ea3dd5 100644 --- a/lib/public/cachefactory.php +++ b/lib/public/cachefactory.php @@ -10,8 +10,17 @@ namespace OCP; interface CacheFactory{ /** + * Get a memory cache instance + * * @param string $prefix * @return $return \OCP\ICache */ public function create($prefix = ''); + + /** + * Check if a memory cache backend is available + * + * @return bool + */ + public function isAvailable(); }