PHPackages                             blink/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. [Caching](/categories/caching)
4. /
5. blink/redis

ActiveLibrary[Caching](/categories/caching)

blink/redis
===========

A redis component for the Blink framework

v0.3.0(8y ago)234.6k↑23.1%MITPHP

Since Jul 26Pushed 8mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (5)Versions (4)Used By (0)

A Redis component for the Blink Framework
=========================================

[](#a-redis-component-for-the-blink-framework)

[![Build Status](https://camo.githubusercontent.com/1e681102c0fb8bb37e0e889f38409fc80ebf098efed6c4238d6735755a6597da/68747470733a2f2f7472617669732d63692e6f72672f72657468696e6b7068702f626c696e6b2d72656469732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rethinkphp/blink-redis)[![Latest Stable Version](https://camo.githubusercontent.com/e09048f4346ad5cdd4a4f1adb9fa7713e1b02a5bb43fbf9d19db3db74c51aaef/68747470733a2f2f706f7365722e707567782e6f72672f626c696e6b2f72656469732f762f737461626c65)](https://packagist.org/packages/blink/redis)[![Latest Unstable Version](https://camo.githubusercontent.com/0c803795b9403468ca1a533071e8a4a45b71286631ff993885772f7d2fc8b24e/68747470733a2f2f706f7365722e707567782e6f72672f626c696e6b2f72656469732f762f756e737461626c65)](https://packagist.org/packages/blink/redis)

Features
--------

[](#features)

- A Redis Client compatible with [Predis](https://github.com/nrk/predis) API
- Implemented PSR-16 SampleCache
- A Session Storage class to store sessions into redis

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

[](#installation)

You can install the latest version of blink-redis by using Composer:

```
composer require blink/redis:dev-master

```

Documentation
-------------

[](#documentation)

### Configuring a redis service

[](#configuring-a-redis-service)

You can easily configure a redis service in the services definition file which located to `src/config/services.php` by default.

The following is a sample example:

```
'redis' => [
    'class' => blink\redis\Client::class,
    'servers' => ['tcp://127.0.0.1:6379'],
]
```

Once the redis service configured, we can access redis server through `app()->redis` in our application. As the Redis component is based on [Predis](https://github.com/nrk/predis), you can refer their documentation on how to issue command to redis servers.

### Using redis as a cache service

[](#using-redis-as-a-cache-service)

The component provides a PSR-16 SampleCache implementation which using redis as a cache storage. We can define a cache service in `services.php` likes the folowing:

```
'cache' => [
    'class' => blink\redis\cache\SampleCache::class,
    'redis' => 'redis', // The redis service to store cached data
    'prefix' => '',     // The prefix of cached key
]
```

Once the cache service configured, we can access the cache service through `app()->cache` in our application.

### Using redis as session storage

[](#using-redis-as-session-storage)

The component also provides a Session Storgae class which allows Blink to store application sessions into redis. we can configure the session storage in the following way:

```
'session' => [
    'class' => blink\session\Manager::class,
    'expires' => 3600 * 24 * 15,
    'storage' => [
        'class' => blink\redis\session\Storage::class,
        'redis' => 'redis',  // the redis service to store sessions
    ]
],
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance43

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

2

Last Release

256d ago

Major Versions

v0.3.0 → v1.x-dev2025-09-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/5291f9967c4bb1cfda7f50ecde566eb5b554352fa6f7eb7920104d58704400f5?d=identicon)[bixuehujin](/maintainers/bixuehujin)

---

Top Contributors

[![bixuehujin](https://avatars.githubusercontent.com/u/1145280?v=4)](https://github.com/bixuehujin "bixuehujin (20 commits)")

---

Tags

blinkblink-frameworkcachephppsr-16redisrediscacheBlink

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cache/predis-adapter

A PSR-6 cache implementation using Redis (Predis). This implementation supports tags

272.6M13](/packages/cache-predis-adapter)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

523.9M27](/packages/cache-redis-adapter)[contributte/redis

Redis client integration into Nette framework

181.6M2](/packages/contributte-redis)[pstaender/silverstripe-redis-cache

Enables Redis cache for SilverStripe

1199.1k](/packages/pstaender-silverstripe-redis-cache)[abouvier/slim-redis-cache

Redis cache middleware for Slim framework

172.0k](/packages/abouvier-slim-redis-cache)[bnomei/kirby3-redis-cachedriver

Advanced Redis cache-driver with in-memory store, transactions and preloading

101.7k](/packages/bnomei-kirby3-redis-cachedriver)

PHPackages © 2026

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