PHPackages                             factorenergia/yii2-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. factorenergia/yii2-ldap

ActiveYii2-extension

factorenergia/yii2-ldap
=======================

Ldap

2.0.0(6y ago)115.4k↓100%2MITPHPPHP &gt;=7.0

Since May 2Pushed 6y agoCompare

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

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Ldap database and ActiveRecord for Yii 2
========================================

[](#ldap-database-and-activerecord-for-yii-2)

This extension provides the LDAP integration for the Yii framework 2.0. It includes basic querying/search support and also implements the ActiveRecord pattern that allows you to store active records in Active Directory or OpenLDAP.

Requirements
------------

[](#requirements)

To use yii2-ldap, your sever must support:

PHP LDAP Extension

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist factorenergia/yii2-ldap

```

or add

```
"factorenergia/yii2-ldap": "*"
```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

```
return [
    //....
    'components' => [
        'ldap' => [
            'class' => 'factorenergia\ldap\Connection',
            // Mandatory Configuration Options
            'dc' => [
                '192.168.1.1',
                'ad.com'
            ],
            'baseDn'          => 'dc=ad,dc=com',
            'username'        => 'administrator@ad.com',
            'password'        => 'password',
            // Optional Configuration Options
            'port'            => 389,
            'followReferrals' => false,
            'useTLS'          => true,
            // Change pageSize (e.g. to 1000) if you are getting the following message
            // with large result sets:
            // ldap_search(): Partial search results returned: Sizelimit exceeded
            'pageSize'        => -1,
        ],
    ]
];
```

Authenticating Users
--------------------

[](#authenticating-users)

To authenticate users using your AD server, call the `Yii::$app->ldap->auth()`method on your provider:

```
try {
    if (Yii::$app->ldap->auth($this->username, $password)) {
        // Credentials were correct.
    } else {
        // Credentials were incorrect.
    }
} catch (Exception $e) {
    // error
}
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.8% 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 ~1098 days

Total

2

Last Release

2198d ago

Major Versions

1.0.0 → 2.0.02020-05-05

PHP version history (2 changes)1.0.0PHP &gt;=5.6

2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28297420?v=4)[Toni Huertas](/maintainers/factorenergia)[@factorenergia](https://github.com/factorenergia)

---

Top Contributors

[![chrmmota](https://avatars.githubusercontent.com/u/242634898?v=4)](https://github.com/chrmmota "chrmmota (52 commits)")[![factorenergia](https://avatars.githubusercontent.com/u/28297420?v=4)](https://github.com/factorenergia "factorenergia (7 commits)")[![chrmorandi](https://avatars.githubusercontent.com/u/11622005?v=4)](https://github.com/chrmorandi "chrmorandi (5 commits)")[![jvidalv](https://avatars.githubusercontent.com/u/27777508?v=4)](https://github.com/jvidalv "jvidalv (1 commits)")[![rimas-kudelis](https://avatars.githubusercontent.com/u/2812673?v=4)](https://github.com/rimas-kudelis "rimas-kudelis (1 commits)")

---

Tags

yii2extensionldapactive directoryopenldap

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/factorenergia-yii2-ldap/health.svg)

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

###  Alternatives

[chrmorandi/yii2-ldap

Ldap

1453.1k](/packages/chrmorandi-yii2-ldap)[ldaptools/ldaptools

LdapTools is a feature-rich LDAP library for PHP 5.6+.

204263.9k1](/packages/ldaptools-ldaptools)[edvlerblog/yii2-adldap-module

yii2 Active Directory implementation (wrapper for Adldap2)

51227.3k](/packages/edvlerblog-yii2-adldap-module)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[causal/ig_ldap_sso_auth

This extension provides LDAP support for TYPO3 by delegating the authentication of frontend and/or backend users to the centrally-managed directory of your organization. It fully supports OpenLDAP and Active Directory and is capable of connecting securely to the authentication server using either TLS or SSL (ldaps://). In case of use in an intranet environment, this extension is a perfect match since it natively brings Single Sign-On (SSO) capability to TYPO3 without any complex configuration.

33377.4k](/packages/causal-ig-ldap-sso-auth)[ldaptools/ldaptools-bundle

Provides easy LDAP integration for Symfony via LdapTools.

49159.5k](/packages/ldaptools-ldaptools-bundle)

PHPackages © 2026

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