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

ActiveLibrary[Caching](/categories/caching)

nuwber/yii2-phpredis
====================

yii2 with phpredis

v2.1.1(4y ago)128.4k↓50%1BSD-3-ClausePHPPHP &gt;=7.2

Since Oct 17Pushed 4y agoCompare

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

READMEChangelog (3)Dependencies (3)Versions (7)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](https://github.com/nuwber/yii2-phpredis/actions/workflows/build.yml/badge.svg)](https://github.com/nuwber/yii2-phpredis/actions/workflows/build.yml)[![codecov](https://camo.githubusercontent.com/f857fd6fc6731ace2b42e645fa7b7ef8b81b1d77c58c9980963c65e705257685/68747470733a2f2f636f6465636f762e696f2f67682f6e75776265722f796969322d70687072656469732f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d383759514630394e4a34)](https://codecov.io/gh/nuwber/yii2-phpredis)

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

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

[](#installation)

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

Either run

```
composer require --prefer-dist nuwber/yii2-phpredis
```

or add

```
"nuwber/yii2-phpredis": "^2.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' => \nuwber\yii2redis\Connection::class,
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0,
        ],
        'cache' => [
            'class' => \nuwber\yii2redis\Cache::class,
        ],
        'session' => [
            'class' => \nuwber\yii2redis\Session::class,
        ],
    ],
];
```

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

[](#run-unit-test)

You can specific your redis config

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

and Run

```
$ ./vendor/bin/phpunit
```

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 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% 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 ~432 days

Total

5

Last Release

1771d ago

Major Versions

v1.1 → v2.02019-06-28

PHP version history (3 changes)v1.0PHP &gt;=5.4.0

v2.0PHP &gt;=7.0

v2.1PHP &gt;=7.2

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/33055211?v=4)[Andrew](/maintainers/andrew-nuwber)[@andrew-nuwber](https://github.com/andrew-nuwber)

---

Top Contributors

[![dcb9](https://avatars.githubusercontent.com/u/3984347?v=4)](https://github.com/dcb9 "dcb9 (9 commits)")[![andrew-nuwber](https://avatars.githubusercontent.com/u/33055211?v=4)](https://github.com/andrew-nuwber "andrew-nuwber (4 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)")

---

Tags

phpredisredisyii2yii2-extension

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[devgroup/yii2-tag-dependency-helper

Helper for unifying cache tag names with invalidation support in yii2

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

Provides translucent api for moving large tasks out of request context

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

Runtime minification and combination of asset files.

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

PHPackages © 2026

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