php-extended / php-ldap-dn-object
A library that implements the php-ldap-dn-interface library
Package info
gitlab.com/php-extended/php-ldap-dn-object
pkg:composer/php-extended/php-ldap-dn-object
9.0.7
2026-05-20 00:44 UTC
Requires
- php: >=8.2
- php-extended/php-ldap-dn-interface: ^9
- php-extended/php-parser-object: ^9
Requires (Dev)
This package is auto-updated.
Last update: 2026-05-19 22:46:32 UTC
README
A library that implements the php-ldap-dn-interface library
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.pharfrom their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-ldap-dn-object ^9
Basic Usage
This library creates dn with the following constructor :
use PhpExtended\Ldap\LdapDistinguishedName;
$ldn = new LdapDistinguishedName([
'c' => 'fr',
'o' => 'foo',
'ou' => 'bar',
'cn' => 'baz',
]);
// gets "cn=baz,ou=bar,o=foo,c=fr"
To parse the distinguished names, do :
use PhpExtended\Ldap\LdapDistinguishedNameParser;
$parser = new LdapDistinguishedNameParser();
$ldn = $parser->parse('cn=baz,ou=bar,o=foo,c=fr');
$ldn->getStringRepresentation(); // gets "cn=baz,ou=bar,o=foo,c=fr"
License
MIT (See license file).