26 Sep 07
Delete all values of an LDAP attribute in PHP
ldap_mod_del( $connection, $dn, array( 'attrib-name' => array() ) );
Copy a directory recursively and keep the symlinks- use cp -R - not cp -r
Relative inclusion of files using include/require in PHP
from comments on http://www.php.net: When I'm dealing with a package that uses relative includes of its own, rather than modify all of their includes, I found it was easier to change PHP's working directory before and after the include, like so:
$wd_was = getcwd();
This way neither my includes nor theirs are affected; they all work as expected. Or:
– it requires attribute values to be indexed by consecutive int keys starting at 0!
— installs OK on Mac OS X 10.4
— if you activate it in php.ini, then commandline PHP stops working!
— error traces refer to PHP sources with lines starting at 0, not starting at 1!
When updating/creating an LDAP object in PHP and you get a funny attribute value
– if the attribute schema is a DN to (any) object
– and if the attrib value shows up as [Root] in ConsoleOne of Novell eDirectory
– and if the attrib values shows as null/empty string in PHP ldap_search and commandline ldapserch
– then you saved/created the object passing PHP null as the value of that attribute to PHP ldap_mod_add()
– solution: remove PHP null values when creating a new LDAP object. If updating an existing LDAP object, remove any existing values of that attribute by ldap_mod_del()