PHPackages                             ruesin/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. ruesin/redis

ActiveLibrary[Caching](/categories/caching)

ruesin/redis
============

Redis utils classes

v0.0.1(7y ago)0101Apache-2.0PHP

Since Feb 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ruesin/redis-utils)[ Packagist](https://packagist.org/packages/ruesin/redis)[ Docs](https://github.com/ruesin)[ RSS](/packages/ruesin-redis/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Redis-Utils
===========

[](#redis-utils)

基于[predis](https://github.com/nrk/predis)的单例类，没有对`Predis`做任何修改，仅为了方便使用而加了层单例壳。

1. 使用`setConfig($name, $config)`加载配置到静态属性`$configs`中，`$name`为连接名，`$config`为连接选项参数
2. 使用`getInstance($name)`获取指定连接名`$name`的`\Predis\Client`实例
3. 获取的即为`\Predis\Client`实例，直接[使用](https://github.com/nrk/predis)即可

```
$configs = [
    'default' => [
        'host' => '127.0.0.1',
        'port' => '6379',
        'database' => '0',
        'username' => '',
        'password' => '',
        'prefix' => 'default:'
    ],
    'web' => [
        'host' => '127.0.0.1',
        'port' => '6379',
        'database' => '0',
        'username' => '',
        'password' => '',
        'prefix' => 'web:'
    ]
];
//加载配置到静态属性
foreach ($configs as $key => $config) {
    \Ruesin\Utils\Redis::setConfig($key, $config);
}

//获取实例
$redis = \Ruesin\Utils\Redis::getInstance('default');
$redis->set('name', 'ruesin');
echo $redis->get('name') . PHP_EOL;

//关闭连接
\Ruesin\Utils\Redis::close('default');

//清理所有连接
\Ruesin\Utils\Redis::clear();
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Unknown

Total

1

Last Release

2689d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8240739?v=4)[ruesin](/maintainers/ruesin)[@ruesin](https://github.com/ruesin)

---

Top Contributors

[![ruesin](https://avatars.githubusercontent.com/u/8240739?v=4)](https://github.com/ruesin "ruesin (22 commits)")

---

Tags

redisutils

### Embed Badge

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

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

###  Alternatives

[rhubarbgroup/redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.

52999.8k1](/packages/rhubarbgroup-redis-cache)[monospice/laravel-redis-sentinel-drivers

Redis Sentinel integration for Laravel and Lumen.

103843.6k](/packages/monospice-laravel-redis-sentinel-drivers)[symfony-bundles/redis-bundle

Symfony Redis Bundle

271.2M6](/packages/symfony-bundles-redis-bundle)[jamescauwelier/psredis

Sentinel client for the popular php redis client

77397.5k5](/packages/jamescauwelier-psredis)[cache/predis-adapter

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

272.6M13](/packages/cache-predis-adapter)[pdffiller/qless-php

PHP Bindings for qless

29113.7k1](/packages/pdffiller-qless-php)

PHPackages © 2026

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