PHPackages                             putyy/php-kv - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. putyy/php-kv

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

putyy/php-kv
============

The php-kv Packages

1.0.1(2y ago)4771MITPHPPHP &gt;=7.2

Since Nov 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/putyy/php-kv)[ Packagist](https://packagist.org/packages/putyy/php-kv)[ Docs](https://github.com/putyy/php-kv.git)[ RSS](/packages/putyy-php-kv/feed)WikiDiscussions main Synced 1mo ago

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

php-kv
======

[](#php-kv)

php实现有规律的创建key value数据库对应键名称的基础包

```
composer require putyy/php-kv
```

### redis示例

[](#redis示例)

```
class UserInfo extends \Pt\Kv\RedisKv
{
//    protected static $prefix = "test";
//    protected static $project = "wecaht";
    protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
```

```
string(15) "k:user_info:uid"
string(15) "h:user_info:uid"
string(11) "l:user_info"
string(11) "s:user_info"
string(12) "ss:user_info"
```

---

```
class UserInfo extends \Pt\Kv\RedisKv
{
//    protected static $prefix = "test";
    protected static $project = "wecaht";
    protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
```

```
string(22) "k:wecaht:user_info:uid"
string(22) "h:wecaht:user_info:uid"
string(18) "l:wecaht:user_info"
string(18) "s:wecaht:user_info"
string(19) "ss:wecaht:user_info"
```

---

```
class UserInfo extends \Pt\Kv\RedisKv
{
    protected static $prefix = "test";
//    protected static $project = "wecaht";
    protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
```

```
string(20) "test:k:user_info:uid"
string(20) "test:h:user_info:uid"
string(16) "test:l:user_info"
string(16) "test:s:user_info"
string(17) "test:ss:user_info"
```

---

```
class UserInfo extends \Pt\Kv\RedisKv
{
//    protected static $prefix = "test";
//    protected static $project = "wecaht";
//    protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
```

```
string(5) "k:uid"
string(5) "h:uid"
string(1) "l"
string(1) "s"
string(2) "ss"
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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

Total

2

Last Release

1032d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2709edce2efeb0a1f367be0001be4a2ead831c5b9ecb41e78caf30a680af5e2?d=identicon)[putyy](/maintainers/putyy)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/putyy-php-kv/health.svg)

```
[![Health](https://phpackages.com/badges/putyy-php-kv/health.svg)](https://phpackages.com/packages/putyy-php-kv)
```

PHPackages © 2026

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