>-----Ursprüngliche Nachricht----- >Von: Michael B Allen [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 11. Juni 2008 20:43 >An: Stefan Gehrig >Cc: Zend Framework General >Betreff: Re: [fw-general] Zend_Ldap_Ext ready for community review
>On 6/11/08, Stefan Gehrig <[EMAIL PROTECTED]> wrote: >> Hi everyone, >> >> I'm happy to announce that Zend_Ldap_Ext >> (http://framework.zend.com/wiki/display/ZFPROP/Zend_Ldap_Ext+Proposal+-+Stef >> an+Gehrig) is ready for community review. Actually the proposal was ready >> for review some time ago but I missed informing the mailing list (it's the >> second one of my first two proposals ;-). >> The source is available from >> http://svn2.assembla.com/svn/zf-proposals/Zend_Ldap_Ext/trunk. >> >> Zend_Ldap_Ext extends existing Zend_Ldap with methods to search the >> directory and with core CRUD-methods. This can be considered a object >> oriented wrapper around the most common ext/ldap functions. It also provides >> helper functions to deal with LDAP entry creation and password setting. >> Furthermore the proposal provides methods to traverse a LDAP tree in an >> object oriented way. >> The source cannot be considered feature complete by now but all of the most >> important stuff is currently working. >> >> Please take a look and let us know what you think. > >What functional benifit does this API have over the builtin PHP LDAP API? First of all I think Zend Framework should provide a first class object-oriented approach to a LDAP directory, the way Zend_Db provides an interface to databases. The current Zend_Ldap implementation is limited to, but perfect for, authentication scenarios only, but LDAP in general provides much more capabilities. Using ext/ldap is in my opionion sometimes very annoying - especially dealing with three different resource types (connection, search result, entry) cries for an easy to use object-oriented approach. Therefore my proposal builds on a base connection class (Zend_Ldap_Ext - whereas naming is still subjected to change) extending Zend_Ldap that provides methods to - search a directory - retrieve single entries - count filter results without fetching the entries - count children of a given DN - check the existence of DNs - add entries - update existing entries - save entries (determines whether to update or to add) - delete entries; includes recursive deletion - move an entry to a different sub-tree; includes recursive movement - move/rename an entry to a different DN; includes recursive movement; uses ldap_rename() if available and possible - copy an entry to a different sub-tree; includes recursive copy - copy an entry to a different DN; includes recursive copy - access the object-oriented tree traversal Zend_Ldap_Ext manages its underlying connection resource. Zend_Ldap_QueryResult is used by Zend_Ldap_Ext to encapsulate ext/ldap query results. It provides Iterator and Countable implementations, so that it can be used with count() and foreach(), and manages its underlying search result and current entry resource. The proposal also includes an optional object-oriented approach for traversing the directory tree. Zend_Ldap_Ext provides getNode() and getBaseNode() that return an object of Zend_Ldap_Node which in turn provides methods to access the entry's attributes (getter and setter) and its children (implementing ArrayAccess, IteratorAggregate and Countable to access attributes). Zend_Ldap_Node_Children is a class to provide access to an entry's child-collection which implements Iterator, RecursiveIterator and Countable in which RecursiveIterator allows the use of a RecursiveIteratorIterator to traverse a complete tree or sub-tree recursively. Furthermore the proposal includes a Zend_Ldap_Helper utility class that provides methods to - set attributes in a unified way so that the resulting array is compatible to ext/ldap; setting includes the conversion of PHP data types into LDAP representations, such as Boolean to "TRUE"/"FALSE", arrays and objects to a serialized stream and file-streams will be read by stream_get_contents() - retrieve attribute values in a unified way and conversion of LDAP Boolean values "TRUE" and "FALSE" to its PHP equivalents. - setting password attributes (currently only {MD5} and {SHA}) - setting and retrieving of LDAP date/time values with conversion from and to PHP timestamps (respects time-zone settings in LDAP attribute value). - improve Zend_Ldap::explodeDn() - implode an array of RDN parts - implode an array of DN parts - escape and unescape filter value strings - escape and unescape DN part strings And last but not least, but admittingly less important and more or less a gimmick, the proposal also includes an object-oriented interface to construct LDAP filter strings. I hope that answers your question as Zend_Ldap_Ext should be more than a basic wrapper around ext/ldap with an additional benefit. Perhaps we can join forces on this proposal as you certainly already have a lot of experience (a lot more than myself I think) in the LDAP and ext/ldap business. Best regards Stefan
