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

ActiveYii2-extension[Database &amp; ORM](/categories/database)

ancor/yii2-redis
================

Redis component for Yii2

2127PHP

Since Mar 10Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ancor-dev/yii2-redis)[ Packagist](https://packagist.org/packages/ancor/yii2-redis)[ RSS](/packages/ancor-yii2-redis/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Redis component for Yii2
========================

[](#redis-component-for-yii2)

Description
-----------

[](#description)

This component is wrapper, it based on really powerful [php-redis](https://github.com/phpredis/phpredis) extension.
Please, install those php-extension before use this.

Documentation can be found at [here](https://github.com/phpredis/phpredis#table-of-contents)

Feel free to let me know what else you want added via:

- [Issues](https://github.com/ancor-dev/yii2-redis/issues)

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

[](#installation)

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

Either run

```
$ php composer.phar require ancor/yii2-redis
```

or add

```
"ancor/yii2-redis": "dev-master"

```

to the `require` section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Configuration is easy. Add this to your `main-local.php` config

```
'components' => [
    'redis' => \redis\redis\Redis::build(),
],
```

Or with settings

```
'components' => [
    'redis' => \redis\redis\Redis::build([
        // 'host'    => '127.0.0.1',
        // 'port'    => 6379,
        // 'timeout' => 0,

        // 'retryInterval' => null,

        // 'password' => null,
        // 'database' => 0, // default database number
    ]),
],
```

Usage
-----

[](#usage)

```
$redis = Yii::$app->redis;

$redis->set('my:key', 'some-value');
$res = $redis->get('my:key');
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/11b715dbbb813e6d3cd3c1bba6a6f7b8af7ffb0aa9d1b1a46a11910a2c41cb45?d=identicon)[ancor.dev](/maintainers/ancor.dev)

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)

PHPackages © 2026

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