Commit e4c05acf authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #16170 from owncloud/fix-15621

drop global file cache support, fixes #15621
parents dfd45177 57e8b76f
......@@ -78,8 +78,6 @@ class Connection extends LDAPUtility {
$memcache = \OC::$server->getMemCacheFactory();
if($memcache->isAvailable()) {
$this->cache = $memcache->create();
} else {
$this->cache = \OC\Cache::getGlobalCache();
}
$this->hasPagedResultSupport =
$this->ldap->hasPagedResultSupport();
......@@ -195,7 +193,7 @@ class Connection extends LDAPUtility {
if(!$this->configured) {
$this->readConfiguration();
}
if(!$this->configuration->ldapCacheTTL) {
if(is_null($this->cache) || !$this->configuration->ldapCacheTTL) {
return null;
}
if(!$this->isCached($key)) {
......@@ -215,7 +213,7 @@ class Connection extends LDAPUtility {
if(!$this->configured) {
$this->readConfiguration();
}
if(!$this->configuration->ldapCacheTTL) {
if(is_null($this->cache) || !$this->configuration->ldapCacheTTL) {
return false;
}
$key = $this->getCacheKey($key);
......@@ -225,12 +223,15 @@ class Connection extends LDAPUtility {
/**
* @param string $key
* @param mixed $value
*
* @return string
*/
public function writeToCache($key, $value) {
if(!$this->configured) {
$this->readConfiguration();
}
if(!$this->configuration->ldapCacheTTL
if(is_null($this->cache)
|| !$this->configuration->ldapCacheTTL
|| !$this->configuration->ldapConfigurationActive) {
return null;
}
......@@ -240,7 +241,9 @@ class Connection extends LDAPUtility {
}
public function clearCache() {
$this->cache->clear($this->getCacheKey(null));
if(!is_null($this->cache)) {
$this->cache->clear($this->getCacheKey(null));
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment