From f41c4312ff4c99bebf9475c61faaf07edb5b6179 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 17 Aug 2013 17:22:54 +0200 Subject: [PATCH] LDAP: use memcache if available --- apps/user_ldap/lib/connection.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 0372112f0e2..e5d9b4d5b40 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -80,7 +80,12 @@ class Connection { public function __construct($configPrefix = '', $configID = 'user_ldap') { $this->configPrefix = $configPrefix; $this->configID = $configID; - $this->cache = \OC_Cache::getGlobalCache(); + $memcache = new \OC\Memcache\Factory(); + if($memcache->isAvailable()) { + $this->cache = $memcache->create(); + } else { + $this->cache = \OC_Cache::getGlobalCache(); + } $this->config['hasPagedResultSupport'] = (function_exists('ldap_control_paged_result') && function_exists('ldap_control_paged_result_response')); } -- 2.39.5