From decbcd5a752bda3034db4240edf74bf618b3cb17 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 21 Feb 2008 08:16:15 +0000 Subject: [PATCH] Updated ldap class. -Cache the result of get_objectclasses. It took 13seconds when deleting ~20 FAI objects. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9003 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 61ecc9d8a..642908017 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -1110,6 +1110,12 @@ class LDAP{ return($objectclasses); } } + + /* Return the cached results. */ + if(class_available('session') && session::is_set("LDAP_CACHE::get_objectclasses")){ + $objectclasses = session::get("LDAP_CACHE::get_objectclasses"); + return($objectclasses); + } # Get base to look for schema $sr = @ldap_read ($this->cid, NULL, "objectClass=*", array("subschemaSubentry")); @@ -1173,6 +1179,9 @@ class LDAP{ } } + if(class_available("session")){ + session::set("LDAP_CACHE::get_objectclasses",$objectclasses); + } return $objectclasses; } -- 2.30.2