things I don't like with ldap_search()

From: Date: Thu, 04 Jan 2001 14:56:08 +0000
Subject: things I don't like with ldap_search()
Groups: php.dev 
Request: Send a blank email to php-dev+get-42933@lists.php.net to get a copy of this message
There a few things that I don't like with the current ldap_search(). There are several situations where there are data returned from a search where the result is not LDAP_SUCCESS, current code will return the data if the result is LDAP_SIZELIMIT_EXCEEDED, but I would also like to do it when the result is LDAP_ADMINLIMIT_EXCEEDED and probably others. With LDAPv3 there are also situations where you get a referral or other errors where you need the result entry to see what happened. I'm writing a function to extract this from the result, but then I need ldap_search() to return a result identifier also for LDAP_REFERRAL and some others. So, I want ldap_search() to return a result identifier more often than it currently does, personally I would like it to always return a result identifier unless ldap_search_s() returns -1. Then PHP applications can always get all the information about what happened, and get all error messages, result codes, referrals etc. from the results. The problem with this, is that there might be applications that think that there were no matches, when the reality is that something went wrong. They could use ldap_errno etc. to see what happened but there are probably a lot of poorly written PHP scripts that don't bother. These scripts don't work that well today either though, there might be some data returned from the server, while they just think that the search didn't work, or with sizelimit exceeded they believe they got all the data (there is a PHP ERROR given though). Bottom line: Can I change ldap_search() to more often return an identifier to get some new possibilities even though some scripts will think everything was okay and that there were no hits? There are alternatives like adding a 9th (too many) parameter or an alternate function, I don't like them. Hope I managed to make myself clear, I'll be happy to discuss this further. Comments? Stig

« previous php.dev (#42933) next »