Re: LDAP DB class
| From: | Ludovico Magnocavallo | Date: | Tue, 08 Jan 2002 16:50:04 +0000 |
| Subject: | Re: LDAP DB class | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-3834@lists.php.net to get a copy of this message | ||
Hi Lukas,
I'm no great LDAP expert either, but I recently (well, yesterday) switched
to using PEAR DB classes and needed an LDAP implementation.....
> I guess this would mean actually working off of an SQL query and parsing
> that to extract the parameters you need (like action etc) => leads to
> overhead
LDAP syntax is very much different from SQL syntax, and even php LDAP
functions are very much different from php database functions.
For example, you could perform a query on LDAP with ldap_search, ldap_read,
ldap_list, all of which have the same interface, but perform different
queries against the LDAP server. Their interface is also different from db
functions, and some of the optional parameters would require a lot of
workarounds to be implemented in SQL syntax.
I may be mistaken, but it would be a lot work to implement a SQL to LDAP
syntax parser, and it will give bad results, or very mediocre results.
Another big difference in LDAP is that search results return only non-empty
fields for each entry, so it's pretty hard to use them like you do for SQL
selects.
I tried to maintain as much compatibility as I could, in fact I only added a
few arguments to the simpleQuery method, and all other methods that depend
on it, and restricted the row methods to return an associative array.
L.