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

ActiveLibrary

homevip/redis
=============

自定义 Redis 类

v1.0.2(3y ago)027MITPHPPHP ^7.0

Since Jul 26Pushed 3y agoCompare

[ Source](https://github.com/homevip/redis)[ Packagist](https://packagist.org/packages/homevip/redis)[ Docs](https://github.com/homevip/redis.git)[ RSS](/packages/homevip-redis/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)DependenciesVersions (5)Used By (0)

### Redis.php

[](#redisphp)

```
// 安装 yaconf 扩展

// 定义配置
$Redis = Redis::instance([
    'host'      =>  config('database.redis.cache.host'),
    'port'      =>  config('database.redis.cache.port'),
    'password'  =>  config('database.redis.cache.password'),
    'db'        =>  config('database.redis.cache.database'),
]);

// 默认配置
$Redis = Redis::instance();

// __call 方法使用 [当类中不存在该方法,直接调用call 实现调用底层redis相关的方法]
var_dump($Redis->set('aaa', 600)); // 添加
var_dump($Redis->get('aaa')); // 获取

```

##### 使用

[](#使用)

```
    use RedisLock;
    public function test(Request $request)
    {
        $key = 'key_' . uniqid();
        $requestID = 'requestID_' . uniqid();

        // 加锁
        if ($this->lock($key, $requestID)) {
            // 代码逻辑

            // 释放锁
            $this->unlock($key, $requestID);
        }
    }

```

##### 管道批量操作

[](#管道批量操作)

```
$conf = [
    'host'      => '192.168.1.9',
    'port'      => '6379',
    'password'  => '123456789',
    'db'        => '0',
];
$redis = new Redis($conf);

// 使用管道批量操作
$pipe = $redis->multi(\Redis::PIPELINE);

$key = 1300000;
for ($i = 0; $i < 2000; $i++) {
    $pipe->hset('public_key', $i, builderOrderSn());
}

dd($pipe->exec());

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Total

3

Last Release

1375d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f533eaf32182fe4b8580df263df959f48aeaa02a1829501668c44b25ad9d116?d=identicon)[homevip](/maintainers/homevip)

---

Top Contributors

[![homevip](https://avatars.githubusercontent.com/u/11925599?v=4)](https://github.com/homevip "homevip (3 commits)")

---

Tags

phplaravelhelperslibrary

### Embed Badge

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

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

###  Alternatives

[panphp/pan

A simple, lightweight, and privacy-focused product analytics php package.

1.2k94.6k5](/packages/panphp-pan)[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.7M101](/packages/dragon-code-support)

PHPackages © 2026

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