From 4002c18065eb324e983a1ecb997af9d2f9b18dde Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Fri, 18 Dec 2009 18:27:45 -0600 Subject: Allow caching of ldap schema, greatly improves performance. --- plugins/LdapAuthentication/LdapAuthenticationPlugin.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins/LdapAuthentication/LdapAuthenticationPlugin.php') diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index f688a3f7e..0ce08bd78 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php @@ -174,6 +174,15 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin return false; } if($config == null) $this->default_ldap=$ldap; + + if (isset($this->schema_cachefile)) { + $cacheConfig = array( + 'path' => $this->schema_cachefile, + 'max_age' => (isset($this->schema_maxage) ? $this->schema_maxage : 1200 ) + ); + $cacheObj = new Net_LDAP2_SimpleFileSchemaCache($cacheConfig); + $ldap->registerSchemaCache($cacheObj); + } return $ldap; } -- cgit v1.2.3-54-g00ecf