Skip to content

Commit 9663bc3

Browse files
committed
Initial commit
0 parents  commit 9663bc3

21 files changed

+822
-0
lines changed

composer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "DaveRandom/LDAPi",
3+
"description": "Simple object oriented wrapper around ext/ldap",
4+
"keywords": ["ldap"],
5+
"homepage": "https://github.com/DaveRandom/LDAPi",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Chris Wright",
10+
"email": "ldapi@daverandom.com",
11+
"homepage": "https://github.com/DaveRandom",
12+
"role": "Developer"
13+
}
14+
],
15+
"autoload": {
16+
"psr-0": {
17+
"LDAPi\\": "src/"
18+
}
19+
}
20+
}

readme.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
LDAPi
2+
=====
3+
4+
A simple object oriented wrapper around PHP's LDAP extension. No frills, just a slightly cleaner API for use in object oriented applications.
5+
6+
Requirements
7+
------------
8+
9+
- PHP 5.4.0 or higher
10+
- ext/ldap
11+
12+
Installation
13+
------------
14+
15+
Preferably via [Composer](http://getcomposer.org/).
16+
17+
Example usage
18+
-------------
19+
20+
<?php
21+
22+
$link = new LDAPi\Directory;
23+
24+
try {
25+
$link->connect('127.0.0.1', 389);
26+
$link->bind('Manager', 'managerpassword');
27+
28+
$result = $link->search('cn=Users', 'objectClass=User', ['cn']);
29+
30+
$entry = $result->firstEntry();
31+
do {
32+
print_r($entry->getAttributes());
33+
} while($entry = $entry->nextEntry());
34+
} catch(LDAPi\DirectoryOperationFailureException $e) {
35+
exit('An error occured: ' . $e->getMessage());
36+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace LDAPi;
4+
5+
class AlreadyAvailableException extends \LogicException {}

src/LDAPi/BindFailureException.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace LDAPi;
4+
5+
class BindFailureException extends DirectoryOperationFailureException {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace LDAPi;
4+
5+
class ConnectFailureException extends DirectoryOperationFailureException {}

0 commit comments

Comments
 (0)