Details
Description
The current Zend_Ldap implementation expects host, portnumber, ssl and tls settings to connect to a directory server. However, this doesn't allow to connect to a socket (when running OpenLDAP on the same server for instance). Also, there's quite some lines of code figuring out the URI that one could specify immediately, but after those lines is an if that discards it all if there was no SLL used.
Personally I'd like to give an URI to ldap_connect, because it also allows failover to other servers. I currently specify 5 servers when connecting to LDAP, so I made my own class that extends Zend_Ldap and overrides the connect function.
I think there must be a sane way to implement this without dropping backwards compatibility, for instance by adding an URI option and using connect with URI when the option is set. Also, ldap_connect should connect to the default server specified in the ldap config files if no arguments are given, it seems to me this currently isn't possible either.
I don't understand why the ability to specify the LDAP URI directly would have any effect on the possibility of using a failover configuration.
Would it OK for your use-case (using a socket connection to the LDAP server via ldapi:// if there was another socket option that allows you to specify the path to the underlying socket?
Regarding your comment about using ldap config files: this will not be possible as e.g. there are no such files with Windows installations of PHP. It also shouldn't be that much work to include the default failover server in the application itself - without relying on external files (whose location is also not very consistent).