An open API service indexing awesome lists of open source software.

https://github.com/daverandom/ldapi

Simple object oriented wrapper around ext/ldap
https://github.com/daverandom/ldapi

Last synced: 8 months ago
JSON representation

Simple object oriented wrapper around ext/ldap

Awesome Lists containing this project

README

          

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](http://getcomposer.org/).

Example usage
-------------

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());
}