PHPackages                             wulixb/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. [Database &amp; ORM](/categories/database)
4. /
5. wulixb/yii2-phpredis

ActiveLibrary[Database &amp; ORM](/categories/database)

wulixb/yii2-phpredis
====================

yii2 with phpredis

2.0(5y ago)01BSDPHPPHP &gt;=7.0

Since Nov 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/wulixb/yii2-phpredis)[ Packagist](https://packagist.org/packages/wulixb/yii2-phpredis)[ RSS](/packages/wulixb-yii2-phpredis/feed)WikiDiscussions master Synced 1mo 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/d202b671a99a634e7dc57ea2c1c7d48d858b5c9b5103dfdbe5c80bc7ca982b88/68747470733a2f2f7472617669732d63692e6f72672f6e75776265722f796969322d70687072656469732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/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

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

2

Last Release

2012d ago

Major Versions

1.0 → 2.02020-11-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/33ff879bd340f2d9f496047992287ad93f1b3bb026e76e42a323386486bceab2?d=identicon)[wulixb](/maintainers/wulixb)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[yii2tech/illuminate

Yii2 to Laravel Migration Package

11315.1k](/packages/yii2tech-illuminate)[mootensai/yii2-relation-trait

Yii 2 Models load with relation, &amp; transaction save with relation

47220.3k9](/packages/mootensai-yii2-relation-trait)[nhkey/yii2-activerecord-history

Storage history of changes to ActiveRecord

46143.4k1](/packages/nhkey-yii2-activerecord-history)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[urbanindo/yii2-dynamodb

DynamoDB extensions for Yii2

1471.4k](/packages/urbanindo-yii2-dynamodb)[spanjeta/yii2-backup

Database Backup and Restore functionality

285.0k1](/packages/spanjeta-yii2-backup)

PHPackages © 2026

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