php-extended / php-ldap-dn-object
A library that implements the php-ldap-dn-interface library
6.0.4
2023-08-21 18:17 UTC
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2023-09-21 18:26:19 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.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-ldap-dn-object ^6
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).