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

ActiveLibrary[Caching](/categories/caching)

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 today

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 31% 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

1421d 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

[swayok/alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea. Powered by cache pool implementations provided by http://www.php-cache.com/

202583.7k8](/packages/swayok-alternative-laravel-cache)[alexmg86/laravel-sub-query

Laravel subquery

7540.2k](/packages/alexmg86-laravel-sub-query)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15195.9k7](/packages/rapidwebltd-rw-file-cache)[jord-jd/do-file-cache

DO File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

1510.3k4](/packages/jord-jd-do-file-cache)[antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

302.6k](/packages/antennaio-laravel-clyde)[michele-angioni/support

Support is a Laravel package which promotes the use of best practices and design patterns.

181.4k1](/packages/michele-angioni-support)

PHPackages © 2026

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