PHPackages                             sunmoon/yiiredis - 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. sunmoon/yiiredis

ActiveLibrary

sunmoon/yiiredis
================

yii2 with phpredis

v1.1.5(6y ago)11BSDPHPPHP &gt;=5.4.0CI failing

Since Dec 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/arieslee/yiiredis)[ Packagist](https://packagist.org/packages/sunmoon/yiiredis)[ RSS](/packages/sunmoon-yiiredis/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

Redis Cache and Session for Yii2
================================

[](#redis-cache-and-session-for-yii2)

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 in redis.

[![Build Status](https://camo.githubusercontent.com/3306b9595f949c4dbf1d982d8c60e1d19b091f922c97cd40960eb826fc376e44/68747470733a2f2f7472617669732d63692e6f72672f73756e6d6f6f6e2f796969322d70687072656469732e737667)](https://github.com/arieslee/yiiredis)[![Code Climate](https://github.com/arieslee/yiiredis/badges/gpa.svg)](https://github.com/arieslee/yiiredis)[![Test Coverage](https://github.com/arieslee/yiiredis/badges/coverage.svg)](https://github.com/arieslee/yiiredis/coverage)[![Issue Count](https://github.com/arieslee/yiiredis/badges/issue_count.svg)](https://github.com/arieslee/yiiredis)[![Latest Stable Version](https://camo.githubusercontent.com/c2045b33fe8ace7b0bbab32bdcc5a6748f5ae0a2545f3f8af9a7730206080634/68747470733a2f2f706f7365722e707567782e6f72672f73756e6d6f6f6e2f796969322d70687072656469732f76657273696f6e)](https://packagist.org/packages/sunmoon/yiiredis)[![Total Downloads](https://camo.githubusercontent.com/05da5b0b03974653d58e959855d418c6b1f76008e7990790833dc47dcb3d9fb9/68747470733a2f2f706f7365722e707567782e6f72672f73756e6d6f6f6e2f796969322d70687072656469732f646f776e6c6f616473)](https://packagist.org/packages/sunmoon/yiiredis)[![License](https://camo.githubusercontent.com/54ba1fb5c4fd8c1146f4bf8969f528f98943f7f49b85e4314933dea6cc591c3e/68747470733a2f2f706f7365722e707567782e6f72672f73756e6d6f6f6e2f796969322d70687072656469732f6c6963656e7365)](https://packagist.org/packages/sunmoon/yiiredis)

**Notice: THIS REPO DOES NOT SUPPORT ACTIVE RECORD.**

**Forked from .**

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

[](#requirements)

- PHP &gt;= 5.4.0
- Redis &gt;= 2.6.12
- ext-redis &gt;= 2.2.7
- Yii2 ~2.0.4

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

[](#installation)

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

Either run

```
composer require --prefer-dist sunmoon/yiiredis

```

or add

```
"sunmoon/yiiredis": "~1.1.1"
```

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' => 'sunmoon\redis\Connection',
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0,
        ],
    ]
];
```

Run unit test
-------------

[](#run-unit-test)

You can specific your redis config

```
$ cp tests/config.php tests/config-local.php
$ vim tests/config-local.php

```

and Run

```
$ ./vendor/bin/phpunit
PHPUnit 5.6.1 by Sebastian Bergmann and contributors.

............                           12 / 12 (100%)

Time: 600 ms, Memory: 10.00MB

OK (12 tests, 50 assertions)

```

Performance test
----------------

[](#performance-test)

```
$ php tests/performance.php

```

[![phpredis-vs-yii-redis](./phpredis-vs-yii-redis.png)](./phpredis-vs-yii-redis.png)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Total

5

Last Release

2343d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/756eb263863387688e6d5bcdf34bb00d68c0269602e66a17e676f437433529ea?d=identicon)[sunmoon](/maintainers/sunmoon)

---

Top Contributors

[![arieslee](https://avatars.githubusercontent.com/u/2550216?v=4)](https://github.com/arieslee "arieslee (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sunmoon-yiiredis/health.svg)

```
[![Health](https://phpackages.com/badges/sunmoon-yiiredis/health.svg)](https://phpackages.com/packages/sunmoon-yiiredis)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)

PHPackages © 2026

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