PHPackages                             e96/yii2-redis - 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. [Caching](/categories/caching)
4. /
5. e96/yii2-redis

ActiveYii2-extension[Caching](/categories/caching)

e96/yii2-redis
==============

Redis Cache, Session and ActiveRecord for the Yii framework

2.1.8(8y ago)46.4k1BSD-3-ClausePHP

Since Nov 30Pushed 8y ago22 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (40)Used By (0)

yii2-redis module with various fixes and speedups
=================================================

[](#yii2-redis-module-with-various-fixes-and-speedups)

- [storing pk in hashes](https://github.com/E96/yii2-redis/commit/4d2eb58b14316c55ea978f26bf0b6d6122fbeec1)
- [getting long string failure](https://github.com/E96/yii2-redis/commit/fdaf09f4d191c7bf29d5e75432385611b90759af)
- [min and max number comparison](https://github.com/E96/yii2-redis/commit/c1e0f6e1c03007a1133ce7916a4683a242e3515f)
- [a bit more info in traces](https://github.com/E96/yii2-redis/commit/fe8df386a0dadbbc192f1be48c2e4dd899c12b98)
- [profiles in debugger DB panel](https://github.com/E96/yii2-redis/commit/05d8d208b25d57b41cb78e04689ccca5be33b473)
- [convert inCondition for one key](https://github.com/E96/yii2-redis/commit/36d6a145acf109d86eb2aa7918f64bc91c935ebb)
- [correct detection modified values](https://github.com/E96/yii2-redis/commit/e4040f0f5c91e291b4b014661d3e85731426f647)
- [correct detection modified values +](https://github.com/E96/yii2-redis/commit/2d2bd7fb72a5702c66f41bce5aee8d1f163e094b)
- [correct detection modified values +](https://github.com/E96/yii2-redis/commit/0238c137ce7e1e76cc832d57538e675b2e462563)
- [fix populate null attributes](https://github.com/E96/yii2-redis/commit/02c879b865937b39f47fb0664329310dcaf3ff94)
- [fix integer values in buildKey](https://github.com/E96/yii2-redis/commit/da6ed85ed15bd33b4137083403c027a15b9fc03d)
- [Make Connection::parseResponse public](https://github.com/E96/yii2-redis/commit/f5ce8325303cda6bd1bc1ecb62d310a5b01661e4)
- [change connection from socket to phpredis](https://github.com/E96/yii2-redis/commit/d28911a005a02cd3b01940bb8e959813599b287a)

Migration guide
===============

[](#migration-guide)

This version incompatible with official extension due pk storage algorithm. To migrate to our version you should migrate your pks. Example code:

```
function fill($keys)
{
    foreach ($keys as $key) {
        yield $key;
        yield 0;
    }
}

$keys = $redis->executeCommand('LRANGE', ['model', 0, -1]);
$keys = iterator_to_array(fill($keys));
$keys = array_unshift($keys, 'model')

$redis->executeCommand('DEL', 'model')
$redis->executeCommand('HMSET', $keys)
```

Redis Cache, Session and ActiveRecord for Yii 2
===============================================

[](#redis-cache-session-and-activerecord-for-yii-2)

This extension provides the [redis](http://redis.io/) key-value store support for the [Yii framework 2.0](http://www.yiiframework.com). It includes a `Cache` and `Session` storage handler and implements the `ActiveRecord` pattern that allows you to store active records in redis.

For license information check the [LICENSE](LICENSE.md)-file.

Documentation is at [docs/guide/README.md](docs/guide/README.md).

[![Latest Stable Version](https://camo.githubusercontent.com/2933fd01bcc4683d676efc985f2100efa6461715b6815edd02b5e3b8d6ceab70/68747470733a2f2f706f7365722e707567782e6f72672f6539362f796969322d72656469732f762f737461626c652e706e67)](https://packagist.org/packages/e96/yii2-redis)[![Total Downloads](https://camo.githubusercontent.com/c7b394712ea1b95923c6c6973a5205d175143d00260ca92d643a43e4925a8a10/68747470733a2f2f706f7365722e707567782e6f72672f6539362f796969322d72656469732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/e96/yii2-redis)[![Build Status](https://camo.githubusercontent.com/d99e44afe7d34dd1898cbad7d81657dc639b4578bf7ae5dd2bcab64cba375827/68747470733a2f2f7472617669732d63692e6f72672f4539362f796969322d72656469732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/E96/yii2-redis)

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

[](#requirements)

At least redis version 2.6.12 is required for all components to work properly.

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist e96/yii2-redis

```

or add

```
"e96/yii2-redis": "~2.0.0"
```

to the require section of your composer.json.

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

[](#configuration)

To use this extension, you have to configure the Connection class in your application configuration:

```
return [
    //....
    'components' => [
        'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0,
        ],
    ]
];
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community27

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~46 days

Recently: every ~162 days

Total

34

Last Release

3035d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/296aeff8442778437ea316ca1bd2fb30f87292ba6bfb3d897f292474e2c1075f?d=identicon)[bazilio91](/maintainers/bazilio91)

![](https://www.gravatar.com/avatar/5da56097a7c9aced72f9d376741f2e061123d386fd9e86be9c5d3d1435c0bc7a?d=identicon)[m8rge](/maintainers/m8rge)

---

Top Contributors

[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (1909 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (770 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (635 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (321 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (153 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (123 commits)")[![Ragazzo](https://avatars.githubusercontent.com/u/1748844?v=4)](https://github.com/Ragazzo "Ragazzo (75 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (45 commits)")[![suralc](https://avatars.githubusercontent.com/u/730039?v=4)](https://github.com/suralc "suralc (42 commits)")[![pmoust](https://avatars.githubusercontent.com/u/2493339?v=4)](https://github.com/pmoust "pmoust (36 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (26 commits)")[![andruha](https://avatars.githubusercontent.com/u/698990?v=4)](https://github.com/andruha "andruha (25 commits)")[![bazilio91](https://avatars.githubusercontent.com/u/380542?v=4)](https://github.com/bazilio91 "bazilio91 (21 commits)")[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (20 commits)")[![LarryUllman](https://avatars.githubusercontent.com/u/1674823?v=4)](https://github.com/LarryUllman "LarryUllman (18 commits)")[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (16 commits)")[![tarasio](https://avatars.githubusercontent.com/u/1010578?v=4)](https://github.com/tarasio "tarasio (12 commits)")[![bwoester](https://avatars.githubusercontent.com/u/309565?v=4)](https://github.com/bwoester "bwoester (12 commits)")[![crtlib](https://avatars.githubusercontent.com/u/4428231?v=4)](https://github.com/crtlib "crtlib (12 commits)")[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (12 commits)")

---

Tags

rediscachesessionyii2active-record

### Embed Badge

![Health badge](/badges/e96-yii2-redis/health.svg)

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

###  Alternatives

[yiisoft/yii2-redis

Redis Cache, Session and ActiveRecord for the Yii framework

48011.7M245](/packages/yiisoft-yii2-redis)

PHPackages © 2026

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