aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-01 10:35:04 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-01 10:35:04 +0200
commit0f2017c7da6332f66f05e93dd34ea1bf1c134148 (patch)
tree8653a13fca4f8c152da4a3172edf8be9898f0e69
parenta9f666f36e5487d950e77d7cc32020b49ce2f021 (diff)
parentdc4fd43f39db79de2201bf428a35a56fc3070eac (diff)
downloadnextcloud-server-0f2017c7da6332f66f05e93dd34ea1bf1c134148.tar.gz
nextcloud-server-0f2017c7da6332f66f05e93dd34ea1bf1c134148.zip
Merge pull request #24869 from owncloud/ldap_capped_cache
Use a capped memory cache for the user/group cache
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 27bbcfffd69..7c12613f34d 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -36,6 +36,7 @@
namespace OCA\User_LDAP;
+use OC\Cache\CappedMemoryCache;
class Group_LDAP extends BackendUtility implements \OCP\GroupInterface {
protected $enabled = false;
@@ -43,12 +44,12 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface {
/**
* @var string[] $cachedGroupMembers array of users with gid as key
*/
- protected $cachedGroupMembers = array();
+ protected $cachedGroupMembers;
/**
* @var string[] $cachedGroupsByMember array of groups with uid as key
*/
- protected $cachedGroupsByMember = array();
+ protected $cachedGroupsByMember;
public function __construct(Access $access) {
parent::__construct($access);
@@ -57,6 +58,9 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface {
if(!empty($filter) && !empty($gassoc)) {
$this->enabled = true;
}
+
+ $this->cachedGroupMembers = new CappedMemoryCache();
+ $this->cachedGroupsByMember = new CappedMemoryCache();
}
/**