PHPackages                             kadotafig/yii2-ldaprecord - 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. kadotafig/yii2-ldaprecord

ActiveYii2-extension

kadotafig/yii2-ldaprecord
=========================

Yii2 extension for library LdapRecord

v0.2.5(4y ago)011BSD-3-ClausePHPPHP &gt;=7.2

Since Apr 6Pushed 4y agoCompare

[ Source](https://github.com/kadotafig/yii2-ldaprecord)[ Packagist](https://packagist.org/packages/kadotafig/yii2-ldaprecord)[ Docs](https://github.com/kadotafig/yii2-ldaprecord)[ RSS](/packages/kadotafig-yii2-ldaprecord/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (14)Used By (0)

Yii2 LdapRecord extension updated for use with ZimbraLDAP
=========================================================

[](#yii2-ldaprecord-extension-updated-for-use-with-zimbraldap)

[Documentation](https://ldaprecord.com/docs/) for LdapRecord

[Documentation](https://wiki.zimbra.com/wiki/Zimbra_Directory_Service_(LDAP)) for ZimbraLDAP

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

[](#installation)

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

```
php composer.phar require --prefer-dist kadotafig/yii2-ldaprecord "*"

```

or add

```
"kadotafig/yii2-ldaprecord": "*"

```

to the require section of your `composer.json` file.

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

[](#configuration)

```
'components' => [
...
'ldap' => [
            'class' => kadotafig\ldaprecord\LdapRecord::class,
            'providers' => [
                'ad' => [
                    'class' => kadotafig\ldaprecord\LdapRecord::class,
                     // Mandatory Configuration Options
                     'hosts'            => ['192.168.1.1'],
                     'base_dn'          => 'dc=local,dc=com',
                     'username'         => 'admin@local.com',
                     'password'         => 'password',

                     // Optional Configuration Options
                     'port'             => 389,
                     'follow_referrals' => false,
                     'use_ssl'          => false,
                     'use_tls'          => false,
                     'version'          => 3,
                     'timeout'          => 5,

                     // Custom LDAP Options
                     'options' => [
                         // See: http://php.net/ldap_set_option
                         LDAP_OPT_X_TLS_REQUIRE_CERT => LDAP_OPT_X_TLS_HARD
                     ],
                ],
                'ldap' => [
                    'hosts' => ['192.168.1.2'],
                    'base_dn' => 'dc=local,dc=com',
                    'username' => 'cn=admin,dc=mts,dc=by',
                    'password' => 'password',

                    // Optional Configuration Options
                    'port' => 389,
                    'version' => 3,

                    // Custom LDAP Options
                    'options' => [
                        // See: http://php.net/ldap_set_option
                        LDAP_OPT_X_TLS_REQUIRE_CERT => LDAP_OPT_X_TLS_HARD
                    ],
                ],
            ],
            'zimbra' => [
                    'hosts' => ['192.168.1.2'],
                    'base_dn' => 'dc=local,dc=com',
                    'username' => 'cn=admin,dc=mts,dc=by',
                    'password' => 'password',

                    // Optional Configuration Options
                    'port' => 389,
                    'version' => 3,

                    // Custom LDAP Options
                    'options' => [
                        // See: http://php.net/ldap_set_option
                        LDAP_OPT_X_TLS_REQUIRE_CERT => LDAP_OPT_X_TLS_HARD
                    ],
                ],
            ],
        ],
...
],
```

Usage
-----

[](#usage)

Simple usage without a user model

Query:

```
Yii::$app->ldap->initProvider('ad')->query()->where('cn', '=', 'John Doe')->get();
```

Authentication:

```
Yii::$app->ldap->initProvider('ad')->auth()->attempt('username', 'password', true);
```

Simple usage with a model

Model:

```
class User extends \LdapRecord\Models\ActiveDirectory\User
{
    /**
     * The "booting" method of the model.
     * @throws \LdapRecord\Auth\BindException
     * @throws \LdapRecord\ConnectionException
     */
    protected static function boot()
    {
        Yii::$app->ldap->initProvider('ad');
    }

    protected $connection = 'ad';
}
```

```
$user = User::findByGuid('guid');
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~42 days

Recently: every ~48 days

Total

13

Last Release

1717d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.5.0

0.2.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfea4e4ea60bb9977f806e2e07a09e98a9cc732eca5921050ba9b4ed4395e07c?d=identicon)[kadotafig](/maintainers/kadotafig)

---

Top Contributors

[![nohnaimer](https://avatars.githubusercontent.com/u/8865830?v=4)](https://github.com/nohnaimer "nohnaimer (20 commits)")

---

Tags

yii2extensionldapactive directoryopenldapldaprecordzimbra

### Embed Badge

![Health badge](/badges/kadotafig-yii2-ldaprecord/health.svg)

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

###  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)
