PHPackages                             shiwenyuan/redis-proxy - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. shiwenyuan/redis-proxy

ActiveLibrary[HTTP &amp; Networking](/categories/http)

shiwenyuan/redis-proxy
======================

v1.0.0(7y ago)014PHP

Since Sep 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/shiwenyuan/RedisProxy)[ Packagist](https://packagist.org/packages/shiwenyuan/redis-proxy)[ RSS](/packages/shiwenyuan-redis-proxy/feed)WikiDiscussions master Synced today

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

RedisProxy
==========

[](#redisproxy)

use
---

[](#use)

```
aaaaa

$redis = \RedisProxy\RedisConnector::getInstance();
/********************string*************************/
$redis->set('zhangsan', '66666');//添加一个Key
$zhangsan = $redis->get('zhangsan');//获取一个key
$this->assertEquals($zhangsan, '66666');
$this->assertEquals($redis->del('zhangsan'), 1);//删除一个key

/*********************hash***************************/
$redis->hSet('key', 'field1', 'val1');//塞入一个值
$redis->hSet('key', 'field2', 'val2');
$redis->hSet('key', 'field3', 'val3');
$redis->hSet('key', 'field4', 'val4');
$data = $redis->hGetAll('key');//获取key 下所有值
$data1 = [
    'field1' => 'val1',
    'field2' => 'val2',
    'field3' => 'val3',
    'field4' => 'val4',
];
$this->assertEquals($data, $data1);
$this->assertEquals($redis->hGet('key','field1'), 'val1');//获取一个值
$this->assertEquals($redis->hDel('key','field1'), 1);
$this->assertEquals($redis->hDel('key','field5'), 0);//删除一个值
$this->assertEquals($redis->hMSet('testkey2',['zhangsan'=>1,['lisi'=>1]]), true); //添加多个值
$this->assertEquals($redis->hVals('key'), ['val2','val3','val4']);//获取hash的所有值
/*************************clear db*****************/
$this->assertEquals($redis->flushDB(),1);//清空数据库

/********************************list***************************/
$redis->lPush('listTestKey', '01');//从列表左侧追加一个值
$redis->lPush('listTestKey', '02');
$redis->lPush('listTestKey', '03');
$this->assertEquals($redis->lLen('listTestKey'),3);
$this->assertEquals($redis->rPop('listTestKey'),'01');//从列表右侧弹出一个值
$this->assertEquals($redis->lLen('listTestKey'),2);//获取列表长度
$this->assertEquals($redis->rPush('listTestKey','04'), 3);//向列表右侧追加一个值
$this->assertEquals($redis->blPop(['listTestKey']),['listTestKey','03']);//从列表左侧弹出一个值
$this->assertEquals($redis->lRange('listTestKey',0,-1), [ 02, 04]);//获取列表所有值
$this->assertEquals($redis->lRange('listTestKey',0,0), [2]);//获取列表指定区间值
$redis->lPush('listTestKey', '02');
$redis->lPush('listTestKey', '02');
$this->assertEquals($redis->lRem('listTestKey',2,'02'), 2);//删除两个value 为02的数据
$this->assertEquals($redis->lIndex('listTestKey', 0),2);//获取指定下标的value
$this->assertEquals($redis->lIndex('listTestKey', 2),false);

/*******************************zset********************************/
$redis->zAdd('zSetTestKey',1,'zhangsan');//添加一个集合
$redis->zAdd('zSetTestKey',2,'lisi');
$redis->zAdd('zSetTestKey',3,'wangwu');
$redis->zAdd('zSetTestKey',4,'xiaoming');
$this->assertEquals($redis->zAdd('zSetTestKey',5,'xiaoming2'),1);
$this->assertEquals($redis->zRange('zSetTestKey', 0, -1),['zhangsan','lisi','wangwu','xiaoming','xiaoming2']);//正序排列指定集合
$this->assertEquals($redis->zRangeByScore('zSetTestKey',3,5),['wangwu','xiaoming','xiaoming2']);
$this->assertEquals($redis->zCard('zSetTestKey'), 5);//获取集合长度
$this->assertEquals($redis->zRem('zSetTestKey','xiaoming2'),1);//删除指定val
$this->assertEquals($redis->zRevRange('zSetTestKey', 0, -1),['xiaoming','wangwu','lisi','zhangsan']);//倒序排列指定集合

$this->assertEquals($redis->getSet('getSetTest','zhangssa222n01'),true);//如果KEY不存咋则添加一个KEY 存在则修改
$this->assertEquals($redis->setnx('getSetTest','zhangssa2ss2n01'),true);//如果KEY不存咋则添加一个KEY 存在则不修改
$this->assertEquals($redis->get('getSetTest'),'zhangssa222n01');
$redis->set('getSetTest01','zhangssss');
$this->assertEquals($redis->get('getSetTest01'),'zhangssss');
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

2853d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dcd9a9243b3f6caaf2b88bd9268291c3752984db67ec68e1fed57f5cd07e8a2?d=identicon)[shiwenyuan](/maintainers/shiwenyuan)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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