Hello,

I’m looking into adding control support to all ldap operations in php-ldap.
You can see a WIP PR here: https://github.com/php/php-src/pull/2640

Next step is to add control support for ldap_modify, ldap_add, ldap_search, …

The historic patch for this added functions like ldap_modify_ext, ldap_add_ext… 
for this which I would like to avoid.

So this means I cannot change the return type, only add parameters.
One solution is to change:
bool ldap_modify ( resource $link_identifier , string $dn , array $entry )
Into:
bool ldap_modify ( resource $link_identifier , string $dn , array $entry, array 
$servercontrols, array $clientcontrols, array &$resultcontrols )

The problem is that it still does not give access to the result object and thus 
to errmsg and referrals which can be obtained with ldap_parse_result.

So I was thinking maybe:
bool ldap_modify ( resource $link_identifier , string $dn , array $entry, array 
$servercontrols, array $clientcontrols, [resource &$resultobject])
-> if the last parameter is omitted, it works as before, if it is given, then 
the user will have to call ldap_parse_result on it to get the information it 
wants.

What do you think of this solution ?
I don’t see any other giving access to all available information without BC.

This will have to be changed for almost all ldap_* operations. Even ldap_bind 
can return controls in the result.

Côme

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to