2017 © Pedro Peláez
 

library ldap-core

Object encapsulation of PHP's native ldap functions

image

dreamscapes/ldap-core

Object encapsulation of PHP's native ldap functions

  • Friday, July 13, 2018
  • by Alaneor
  • Repository
  • 5 Watchers
  • 8 Stars
  • 25,938 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 14 Versions
  • 5 % Grown

The README.md

Ldap Core

Build Status Built with GNU Make, (*1)

Object-oriented implementation of PHP's native ldap functions, (*2)

About

This small library provides access to ldap functions in a nice, object-oriented implementation., (*3)

Its purpose is not to provide fancy extra functionality for ldap interaction, but only to provide an object-level encapsulation around native PHP functions in a way that makes sense for OOP world. As such, this library is intended either for those who prefer OOP programming style, for those who want to be able to test their ldap interaction or for those who would like to write their own libraries which provide that fancy extra functionality., (*4)

Installation

Requirements

Support for ldap_modify_batch and ldap_escape are also available as long as they are present in your current PHP version. - ldap_modify_batch - available in PHP 5.4 branch since 5.4.26 and in higher versions of PHP since 5.5.10 - ldap_escape - available since PHP 5.6.0, (*5)

Via Composer

composer require dreamscapes/ldap-core (visit Packagist for list of all available versions), (*6)

Usage

There are two classes - Dreamscapes\Ldap\Core\Ldap and Dreamscapes\Ldap\Core\Result, each of which implement part of the native ldap functions as instance methods (some functions which do not operate on the resource objects are static). The differentiating principle is simple - if the function deals with the state of the ldap connection, it is implemented in the first, whereas functions dealing with the data returned from ldap server (the result resource) are implemented in the latter class., (*7)

Deviations

All methods are named as close to the original functions as possible, although with some improvements:, (*8)

  1. Ldap v3 protocol is used by default
  2. The ldap_ prefix is removed from all method names
  3. The method names are camelCased instead of underscore_based
  4. All methods return data by returning them and not by populating variables passed as references
  5. Some functions are not implemented (usually because they are redundant)
  6. Exceptions are thrown if the ldap protocol encounters an error, and standard PHP warnings and errors are suppressed in most cases

Example

// Load Composer's autoload script...
include 'vendor/autoload.php';

// Import the class into current namespace
use Dreamscapes\Ldap\Core\Ldap;

// If ldap URI is provided, the Ldap instance will also open the connection
// via ldap_connect()
$con = new Ldap('ldap://example.com');
$con->bind('admin@example.com', 'my pass'); // Example AD credentials

// Read the rootDSE entry
$res = $con->read('', 'objectclass=*', ['*']);

// $res is now instance of Result class
echo "Number of entries in resultset: " . $res->countEntries();
print_r($res->getEntries());

Documentation

Online API documentation is available here. To generate API documentation offline:, (*9)

git clone https://github.com/Dreamscapes/Ldap-Core.git
cd Ldap-Core
composer install
make docs

Documentation is now available at ./docs/index.html, (*10)

License

This software is licensed under the BSD (3-Clause) License. See the LICENSE file for more information., (*11)

The Versions

13/07 2018

dev-master

9999999-dev

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

13/07 2018

dev-build-php7

dev-build-php7

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

13/07 2018

dev-update-readme

dev-update-readme

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

13/07 2018

dev-fix-travis-build

dev-fix-travis-build

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

12/07 2018

3.1.1

3.1.1.0

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

07/12 2015

dev-develop

dev-develop

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

04/05 2015

3.1.0

3.1.0.0

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

25/03 2015

3.0.0

3.0.0.0

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

16/12 2014

2.0.1

2.0.1.0

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0
  • ext-ldap *

 

The Development Requires

mock testing library ldap directory oop openldap

16/12 2014

2.0.0

2.0.0.0

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

mock testing library ldap directory oop openldap

31/08 2014

1.0.0

1.0.0.0

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

mock testing library ldap directory oop openldap

26/08 2014

0.1.0-beta.3

0.1.0.0-beta3

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

mock testing library ldap directory oop openldap

02/05 2014

0.1.0-beta.2

0.1.0.0-beta2

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

mock testing library ldap directory oop openldap

14/04 2014

0.1.0-beta.1

0.1.0.0-beta1

Object encapsulation of PHP's native ldap functions

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires