LDAP: use memcache if available

This commit is contained in:
Arthur Schiwon 2013-08-17 17:22:54 +02:00
parent c538ac3081
commit f41c4312ff

View file

@ -80,7 +80,12 @@ class Connection {
public function __construct($configPrefix = '', $configID = 'user_ldap') { public function __construct($configPrefix = '', $configID = 'user_ldap') {
$this->configPrefix = $configPrefix; $this->configPrefix = $configPrefix;
$this->configID = $configID; $this->configID = $configID;
$memcache = new \OC\Memcache\Factory();
if($memcache->isAvailable()) {
$this->cache = $memcache->create();
} else {
$this->cache = \OC_Cache::getGlobalCache(); $this->cache = \OC_Cache::getGlobalCache();
}
$this->config['hasPagedResultSupport'] = (function_exists('ldap_control_paged_result') $this->config['hasPagedResultSupport'] = (function_exists('ldap_control_paged_result')
&& function_exists('ldap_control_paged_result_response')); && function_exists('ldap_control_paged_result_response'));
} }