From b39197475463d42be20819077826fb7f8e629953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.bernigaud@opensides.be> Date: Thu, 3 Dec 2015 10:22:12 +0100 Subject: [PATCH] Attempt at a few optimisations --- include/class_ldap.inc | 8 +++----- include/class_ldapMultiplexer.inc | 5 +---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 22a5f0e48..893fc1aab 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -702,7 +702,8 @@ class LDAP $delarray = array(); /* Get sorted list of dn's to delete */ - $this->ls($srp, "(objectClass=*)", $deletedn); + $this->cd($deletedn); + $this->search($srp, "(objectClass=*)"); while ($this->fetch($srp)) { $deldn = $this->getDN($srp); $delarray[$deldn] = strlen($deldn); @@ -712,11 +713,8 @@ class LDAP /* Really Delete ALL dn's in subtree */ foreach (array_keys($delarray) as $key) { - $this->rmdir_recursive($srp, $key); + $r = @ldap_delete($this->cid, LDAP::fix($key)); } - - /* Finally Delete own Node */ - $r = @ldap_delete($this->cid, LDAP::fix($deletedn)); $this->error = @ldap_error($this->cid); return ($r ? $r : 0); } else { diff --git a/include/class_ldapMultiplexer.inc b/include/class_ldapMultiplexer.inc index 1ddc4b40a..6b7cfb0a3 100644 --- a/include/class_ldapMultiplexer.inc +++ b/include/class_ldapMultiplexer.inc @@ -64,10 +64,7 @@ class ldapMultiplexer { array_unshift($parameters, $this->sr); } - $class = new ReflectionClass($this->object); - $method = $class->getMethod($methodName); - - return $method->invokeArgs($this->object, $parameters); + return call_user_func_array(array($this->object, $methodName), $parameters); } /* -- GitLab