PHPackages                             heyanlong/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. heyanlong/yii2-redis

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

heyanlong/yii2-redis
====================

Redis 3.x Cluster Cache, Session and ActiveRecord for the Yii framework

2.0.4(10y ago)823.7k↓44.6%9[1 issues](https://github.com/heyanlong/yii2-redis/issues)[1 PRs](https://github.com/heyanlong/yii2-redis/pulls)BSD-3-ClausePHP

Since May 25Pushed 5y ago4 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

Redis 3.x Cluster Cache, Session and ActiveRecord for Yii 2
===========================================================

[](#redis-3x-cluster-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.

[![Latest Stable Version](https://camo.githubusercontent.com/7fd29b3ba05bd1e0fcf78a1e66c5cb89996c5d2a7606da739d83fd6a8a5e581b/68747470733a2f2f706f7365722e707567782e6f72672f686579616e6c6f6e672f796969322d72656469732f762f737461626c652e706e67)](https://packagist.org/packages/heyanlong/yii2-redis)[![Total Downloads](https://camo.githubusercontent.com/112f17f62cf77023fa5e0e9864d8f737a9ce58b549c7ca17267f70a33eb7385f/68747470733a2f2f706f7365722e707567782e6f72672f686579616e6c6f6e672f796969322d72656469732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/heyanlong/yii2-redis)[![Build Status](https://camo.githubusercontent.com/49fe90639efce7d81421bd0f7a3457eaf1ee3ef1c19815a9c3d531728ec3487f/68747470733a2f2f7472617669732d63692e6f72672f686579616e6c6f6e672f796969322d72656469732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/heyanlong/yii2-redis)

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

[](#requirements)

At least redis version 3.0 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 heyanlong/yii2-redis

```

or add

```
"heyanlong/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' => 'heyanlong\redis\Connection',
            'master' => [
                '10.155.20.169:6379',
                '10.155.20.167:6391',
                '10.155.20.168:6379',
                '10.155.20.167:6380',
//                'localhost:6379',
            ],
            'database' => 0,
        ],

    ]
];
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

4012d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3367958?v=4)[何延龙](/maintainers/heyanlong)[@heyanlong](https://github.com/heyanlong)

---

Tags

rediscachesessionyii2active-record

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/heyanlong-yii2-redis/health.svg)](https://phpackages.com/packages/heyanlong-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)
