Skip to content

Latest commit

 

History

30 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

LDAPi

A simple object oriented wrapper around PHP's LDAP extension. No frills, just a slightly cleaner API for use in object oriented applications.

Requirements

  • PHP 5.4.0 or higher
  • ext/ldap

Installation

Preferably via Composer.

Example usage

<?php

$link = new LDAPi\Directory;

try {
    $link->connect('127.0.0.1', 389);
    $link->bind('Manager', 'managerpassword');

    $result = $link->search('cn=Users', 'objectClass=User', ['cn']);

    $entry = $result->firstEntry();
    do {
        print_r($entry->getAttributes());
    } while($entry = $entry->nextEntry());
} catch(LDAPi\DirectoryOperationFailureException $e) {
    exit('An error occurred: ' . $e->getMessage());
}

关于

Simple object oriented wrapper around ext/ldap

Resources

Stars

0 stars

关注者

1 watching

复刻s

发布

Used by

贡献者

Languages