Commit 19b9339d authored by Côme Chilliet's avatar Côme Chilliet
Browse files

📚 feat(ldap) Improve README

issue #1
parent b62e8289
Pipeline #8914 passed with stages
in 55 seconds
# FusionDirectory LDAP library
Modern Object Oriented PHP LDAP library which is used by FusionDirectory cli tools.
require 'FusionDirectory/Ldap/autoload.php';
use FusionDirectory\Ldap;
$ldap = new Ldap\Link('ldapi:///');
/* Only EXTERNAL bind is available for now */
/* Make a search */
$list = $ldap->search('ou=people,dc=example,dc=com', '(cn=*)', ['cn'], 'one');
/* Throw FusionDirectory\Ldap\Exception if there was an error */
/* Browse results, Ldap\Result is Traversable */
foreach ($list as $dn => $attributes) {
echo $dn.': '.$attributes['cn'][0]."\n";
/* Ldap\Result is also Countable */
echo 'There was '.count($list).' results'."\n";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment