PHPackages                             qingbing/zf-mem-cache - 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. qingbing/zf-mem-cache

ActiveLibrary[Caching](/categories/caching)

qingbing/zf-mem-cache
=====================

memory 缓存管理

1.0.1(6y ago)02MITPHPPHP &gt;=7.0.0

Since Apr 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/qingbing/zf-mem-cache)[ Packagist](https://packagist.org/packages/qingbing/zf-mem-cache)[ Docs](http://www.phpcorner.net)[ RSS](/packages/qingbing-zf-mem-cache/feed)WikiDiscussions master Synced 1mo ago

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

zf-mem-cache
============

[](#zf-mem-cache)

Mem缓存，继承自"zf-abstract-cache"

简介
==

[](#简介)

- Memory缓存类 "\\Zf\\Cache\\MemoryCache" 提供了 memory 缓存的相关操作
- 该缓存继承自抽象类 "\\Zf\\Cache\\Abstracts\\ACache"

使用范例
====

[](#使用范例)

```
$mem = new \Memcache();
$mem->connect('172.16.37.128', 10000);

// 实例化
$cache = Object::create([
    'class' => MemoryCache::class,
    'namespace' => 'name',
    'mem' => $mem,
]);

$value = $cache->get('name');
var_dump($value);

/* @var $cache ACache */
// ====== 普通用法 ======
// 生成一个缓存
$cache->set('name', 'qingbing', 20);
$cache->set('sex', 'nan');

$value = $cache->get('name');
var_dump($value);

$cache->delete('sex');
var_dump($cache);

$has = $cache->has('grade');
var_dump($has);
$has = $cache->has('name');
var_dump($has);

//$cache->clear();

// ====== 批量用法 ======
$cache->setMultiple([
    'age' => 19,
    'class' => 1,
    'grade' => 2,
], 2000);

$data = $cache->getMultiple([
    'class',
    'name',
    'grade',
    'age',
]);
var_dump($data);

$cache->deleteMultiple(['class', 'name']);

// ====== 键、值随意化 ======
$key = ["sex", "name"];
// 设置缓存
$status = $cache->set($key, ["女", ["xxx"]]);
var_dump($status);
// 获取缓存
$data = $cache->get($key);
var_dump($data);
// 删除缓存
$status = $cache->delete($key);
var_dump($status);
```

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

2221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9379d2ee4885074de75faa3fa12970614186826f762df3c4aa0905dc1ff3b513?d=identicon)[qingbing](/maintainers/qingbing)

---

Top Contributors

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

---

Tags

phpcachememoryzf

### Embed Badge

![Health badge](/badges/qingbing-zf-mem-cache/health.svg)

```
[![Health](https://phpackages.com/badges/qingbing-zf-mem-cache/health.svg)](https://phpackages.com/packages/qingbing-zf-mem-cache)
```

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[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/

202541.1k6](/packages/swayok-alternative-laravel-cache)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

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