PHPackages                             dcb9/yii2-phpredis - 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. dcb9/yii2-phpredis

AbandonedArchivedLibrary[Caching](/categories/caching)

dcb9/yii2-phpredis
==================

yii2 with phpredis

v1.1(9y ago)395.2k14[2 issues](https://github.com/dcb9/yii2-phpredis/issues)BSDPHPPHP &gt;=5.4.0

Since Oct 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dcb9/yii2-phpredis)[ Packagist](https://packagist.org/packages/dcb9/yii2-phpredis)[ RSS](/packages/dcb9-yii2-phpredis/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (3)Versions (3)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/e67ac55f1469dfeb4cc96e652b50178cc2dc1551f662c304858bbf0bf18c29c5/68747470733a2f2f7472617669732d63692e6f72672f646362392f796969322d70687072656469732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dcb9/yii2-phpredis)[![Code Climate](https://camo.githubusercontent.com/b357531977ec93442f567809f5a22d680d6738f98bc76570c3647fb7c8445e67/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f646362392f796969322d70687072656469732f6261646765732f6770612e737667)](https://codeclimate.com/github/dcb9/yii2-phpredis)[![Test Coverage](https://camo.githubusercontent.com/650456c9210f00668fc63308ea14c46bf5c44896ab6137b3460f0bc17f76d741/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f646362392f796969322d70687072656469732f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/dcb9/yii2-phpredis/coverage)[![Issue Count](https://camo.githubusercontent.com/1ef3d3c263fc13ad028055972a25861eff3c682148fa1fcec6267767b3e91c1e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f646362392f796969322d70687072656469732f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/dcb9/yii2-phpredis)[![Latest Stable Version](https://camo.githubusercontent.com/712410e89ae27379256e09af035556141692190fdcacbf17b9a35f31225e1977/68747470733a2f2f706f7365722e707567782e6f72672f646362392f796969322d70687072656469732f76657273696f6e)](https://packagist.org/packages/dcb9/yii2-phpredis)[![Total Downloads](https://camo.githubusercontent.com/7de93bffbd4837366f0f93fa02eec90b049ad737740d2df65468fb185f1c41f2/68747470733a2f2f706f7365722e707567782e6f72672f646362392f796969322d70687072656469732f646f776e6c6f616473)](https://packagist.org/packages/dcb9/yii2-phpredis)[![License](https://camo.githubusercontent.com/0878606a53203a39309c849353e0406287112871991f7559f4fec73bb6251d6c/68747470733a2f2f706f7365722e707567782e6f72672f646362392f796969322d70687072656469732f6c6963656e7365)](https://packagist.org/packages/dcb9/yii2-phpredis)

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

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

```
php composer.phar require --prefer-dist dcb9/yii2-phpredis

```

or add

```
"dcb9/yii2-phpredis": "~1.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' => 'dcb9\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

34

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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 ~254 days

Total

2

Last Release

3288d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0bf3d81236f12ab8f3274e3e899048d44ed9f85b9537c474d958e7676769f3b8?d=identicon)[bobchengbin](/maintainers/bobchengbin)

---

Top Contributors

[![dcb9](https://avatars.githubusercontent.com/u/3984347?v=4)](https://github.com/dcb9 "dcb9 (9 commits)")[![arieslee](https://avatars.githubusercontent.com/u/2550216?v=4)](https://github.com/arieslee "arieslee (3 commits)")[![lgelfan](https://avatars.githubusercontent.com/u/222257?v=4)](https://github.com/lgelfan "lgelfan (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dcb9-yii2-phpredis/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[devgroup/yii2-tag-dependency-helper

Helper for unifying cache tag names with invalidation support in yii2

32520.9k7](/packages/devgroup-yii2-tag-dependency-helper)[bazilio/yii2-async

Provides translucent api for moving large tasks out of request context

6249.6k2](/packages/bazilio-yii2-async)[lajax/yii2-asset-minifier

Runtime minification and combination of asset files.

1010.7k](/packages/lajax-yii2-asset-minifier)

PHPackages © 2026

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