]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: use memcache if available
authorArthur Schiwon <blizzz@owncloud.com>
Sat, 17 Aug 2013 15:22:54 +0000 (17:22 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Sat, 17 Aug 2013 15:22:54 +0000 (17:22 +0200)
apps/user_ldap/lib/connection.php

index 0372112f0e2dc4e1abaaaee530300280d5bfdb9e..e5d9b4d5b40eaf99135c3333f4d87b747a165d9c 100644 (file)
@@ -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'));
        }