[Pkg-owncloud-commits] [owncloud] 14/123: drop global file cache support, fixes #15621

David Prévot taffit at moszumanska.debian.org
Tue May 19 23:55:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 57e8b76f4809aab59bf5f46e722b204211b36fdd
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Thu May 7 14:52:44 2015 +0200

    drop global file cache support, fixes #15621
---
 apps/user_ldap/lib/connection.php | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index b9d83aa..d6f4bdc 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -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));
+		}
 	}
 
 	/**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list