Package Proposal - LDAP_DataObject
| From: | Alan Knowles | Date: | Thu, 20 Feb 2003 16:51:58 +0000 |
| Subject: | Package Proposal - LDAP_DataObject | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-13503@lists.php.net to get a copy of this message | ||
Based around the DB_DataObject API (and some degree the code), I've been working on a similar Object for LDAP - obviously there are some major differences.. but the end usage is pretty similar to DB_DataObject..
summary
- there are no keys in LDAP = the dn= is the key...
- the 'end user' extended classes are collections or singular wrappers around LDAP classes. (stored in $object->_objectclasses - which is used to generate the full objectclass list)
- The validate routine does checks on MUST have and (eventually singular) requirements - based around an ini file generated from my ldap schema viewer..
- There's alot more work dealing with object variables (which end up as arrays when you fetch) - whereAdd builds ldap queries and expects things like cn=acded and formats LDAP queries appropriatly..
- the classic $object->cn = 'xyz', $object->find() work.
- some support for $object->limit(10,20);
- no support for orderBy() currently
- addition of $object->base() is needed for find()
- currently no support for non standard ldap classes (although adding this should not be too dificult..
- tested so far with find/get/insert and update (no delete tests yet)..
Code:
http://devel.akbkhome.com/LDAP_DataObject/DataObject.php.txt
Very Simple demo
http://devel.akbkhome.com/LDAP_DataObject/demo.php.txt
The LDAP datatype Ini file
http://devel.akbkhome.com/LDAP_DataObject/ldap.ini.txt
And a fun demo of it working in a bigger application.. (probably only online for a limited time - so if you read this in the archives it may not work...)
http://devel.akbkhome.com/timesheets/index.php/LDAPbrowse/Person.html
add a few +1 at the top... -- I suggest it goes in the Database Category - although remains being called LDAP_DataObject.. - unless anyone has better ideas :)
Regards
Alan
--
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com