PHPackages                             pilsetnieks/key-value-api - 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. pilsetnieks/key-value-api

ActiveLibrary[Caching](/categories/caching)

pilsetnieks/key-value-api
=========================

Simple key-value cache API to abstract the underlying key-value store.

0.3.1(9y ago)31.6k1MITPHPPHP &gt;= 5.3.0

Since Mar 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pilsetnieks/key-value-api)[ Packagist](https://packagist.org/packages/pilsetnieks/key-value-api)[ Docs](https://github.com/pilsetnieks/key-value-api)[ RSS](/packages/pilsetnieks-key-value-api/feed)WikiDiscussions master Synced 1mo ago

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

key-value-api
=============

[](#key-value-api)

Simple key-value cache API to abstract the underlying key-value store. Currently implements APC and memcache

Usage example
=============

[](#usage-example)

```
$KV = new kv(
	array('Enabled' => false),
	array('Enabled' => true, 'Servers' => $Servers)
);

// Object style
$KV['Value1'] = 'asdf';
echo $KV['Value1']; // Outputs "asdf"
echo '';

// Static class style
echo kv::get('Value1'); // Outputs "asdf";
echo '';
kv::set('Value1', 'qwerty');
echo kv::get('Value1'); // Outputs "qwerty";
echo '';
kv::clear_all();
echo kv::get('Value1'); // Outputs "";
echo '';
kv::set('TestNumber', 42);
echo $KV['TestNumber'];
echo '';
kv::inc('TestNumber', 2);
echo $KV['TestNumber'];

```

Servers for memcache can be specified in multiple ways:

```
$Servers = [
    ['localhost', 11211],
    ['127.0.0.1']
];

$Servers = ['localhost:11211', '127.0.0.1'];

$Servers = 'localhost11211;127.0.0.1';

$KV = new kv(
	array('Enabled' => false),
	array('Enabled' => true, 'Servers' => $Servers)
);

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

3524d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

cacheapcmemcacheKey value

### Embed Badge

![Health badge](/badges/pilsetnieks-key-value-api/health.svg)

```
[![Health](https://phpackages.com/badges/pilsetnieks-key-value-api/health.svg)](https://phpackages.com/packages/pilsetnieks-key-value-api)
```

###  Alternatives

[tedivm/stash

The place to keep your cache.

9824.8M124](/packages/tedivm-stash)[sabre/cache

Simple cache abstraction layer implementing PSR-16

541.2M3](/packages/sabre-cache)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)[ihor/cachalot

Cache a lot in a proper way (APC, XCache, Memcached, Redis, Couchbase)

2528.1k](/packages/ihor-cachalot)[alekseykorzun/memcached-wrapper-php

Optimized PHP 5 wrapper for Memcached extension that supports dog-piling, igbinary and local storage

2984.6k1](/packages/alekseykorzun-memcached-wrapper-php)[swiggles/memcache

Memcache driver for Laravel 5

1449.9k1](/packages/swiggles-memcache)

PHPackages © 2026

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