PHPackages                             xp-framework/ldap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xp-framework/ldap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xp-framework/ldap
=================

LDAP support for the XP Framework

v9.1.1(3y ago)064.6k↓20%1[1 PRs](https://github.com/xp-framework/ldap/pulls)BSD-3-ClausePHPPHP &gt;=7.0.0

Since Jan 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/xp-framework/ldap)[ Packagist](https://packagist.org/packages/xp-framework/ldap)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-framework-ldap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (26)Used By (0)

LDAP support for the XP Framework
=================================

[](#ldap-support-for-the-xp-framework)

[![Build status on GitHub](https://github.com/xp-framework/ldap/workflows/Tests/badge.svg)](https://github.com/xp-framework/ldap/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/f50761e2e5198fa8719b790579156e7f60ccbaa2a87f7cc3307c81178d80a2a1/68747470733a2f2f706f7365722e707567782e6f72672f78702d6672616d65776f726b2f6c6461702f76657273696f6e2e706e67)](https://packagist.org/packages/xp-framework/ldap)

The peer.ldap package implements LDAP (Lighweight Directory Access Protocol) access.

Example (LDAP search)
---------------------

[](#example-ldap-search)

```
use peer\ldap\LDAPConnection;
use util\cmd\Console;

$l= new LDAPConnection('ldap://ldap.example.com');
$l->connect();

$search= $l->search(
  'ou=People,dc=OpenLDAP,dc=Org',
  '(objectClass=*)'
);

Console::writeLinef('===> %d entries found', $search->numEntries());
foreach ($search as $result) {
  Console::writeLine('---> ', $result->toString());
}

$l->close();
```

Example (Modifying an entry)
----------------------------

[](#example-modifying-an-entry)

```
use peer\ldap\{LDAPConnection, LDAPEntry};

$l= new LDAPConnection('ldap://uid=admin,o=roles,dc=planet-xp,dc=net:password@ldap.example.com');
$l->connect();

with ($entry= $l->read(new LDAPEntry('uid=1549,o=people,dc=planet-xp,dc=net'))); {
  $entry->setAttribute('firstname', 'Timm');

  $l->modify($entry);
}

$l->close();
```

Example (Adding an entry)
-------------------------

[](#example-adding-an-entry)

```
use peer\ldap\{LDAPConnection, LDAPEntry};

$l= new LDAPConnection('ldap://uid=admin,o=roles,dc=planet-xp,dc=net:password@ldap.example.com');
$l->connect();

with ($entry= new LDAPEntry('uid=1549,o=people,dc=planet-xp,dc=net')); {
  $entry->setAttribute('uid', 1549);
  $entry->setAttribute('firstname', 'Timm');
  $entry->setAttribute('lastname', 'Friebe');
  $entry->setAttribute('objectClass', 'xpPerson');

  $l->add($entry);
}

$l->close();
```

Dynamically creating LDAP queries
---------------------------------

[](#dynamically-creating-ldap-queries)

If the LDAP queries need to be constructed dynamically the LDAPQuery class provides a printf-style syntax to do so:

```
use peer\ldap\LDAPQuery;

$res= $ldap->searchBy(new LDAPQuery(
  'o=people,dc=planet-xp,dc=net',
  '(&(objectClass=%c)(|(username=%s)(uid=%d)))',
  'xpPerson',
  'friebe'
  1549
));
```

When using the "%s" token, the value passed is escaped according to rules in LDAP query syntax. The %c token copies as-is, and %d handles the argument as numeric value.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 83.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~367 days

Total

23

Last Release

1293d ago

Major Versions

v6.2.0 → v7.0.02016-02-21

v7.4.3 → v8.0.02017-06-15

v8.1.3 → v9.0.02020-04-11

PHP version history (4 changes)v6.0.0PHP &gt;=5.4.0

v7.0.0PHP &gt;=5.5.0

v8.0.0PHP &gt;=5.6.0

v9.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (14336 commits)")[![kiesel](https://avatars.githubusercontent.com/u/127769?v=4)](https://github.com/kiesel "kiesel (2390 commits)")[![ohinckel](https://avatars.githubusercontent.com/u/717217?v=4)](https://github.com/ohinckel "ohinckel (335 commits)")[![Stormwind](https://avatars.githubusercontent.com/u/836872?v=4)](https://github.com/Stormwind "Stormwind (13 commits)")[![andstefiul](https://avatars.githubusercontent.com/u/798415?v=4)](https://github.com/andstefiul "andstefiul (5 commits)")[![kusnier](https://avatars.githubusercontent.com/u/726429?v=4)](https://github.com/kusnier "kusnier (5 commits)")[![beorgler](https://avatars.githubusercontent.com/u/2027220?v=4)](https://github.com/beorgler "beorgler (3 commits)")[![treuter](https://avatars.githubusercontent.com/u/1067905?v=4)](https://github.com/treuter "treuter (3 commits)")[![johannes85](https://avatars.githubusercontent.com/u/470531?v=4)](https://github.com/johannes85 "johannes85 (1 commits)")[![ppetermann](https://avatars.githubusercontent.com/u/69334?v=4)](https://github.com/ppetermann "ppetermann (1 commits)")[![guel1973](https://avatars.githubusercontent.com/u/4669852?v=4)](https://github.com/guel1973 "guel1973 (1 commits)")

---

Tags

ldapphpxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-framework-ldap/health.svg)

```
[![Health](https://phpackages.com/badges/xp-framework-ldap/health.svg)](https://phpackages.com/packages/xp-framework-ldap)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
