PHPackages                             lsys/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. lsys/cache

ActiveLibrary[Caching](/categories/caching)

lsys/cache
==========

lsys module cache

0.0.1(6y ago)0651Apache-2.0PHPCI failing

Since Jul 3Pushed 6y agoCompare

[ Source](https://github.com/php-lsys/cache)[ Packagist](https://packagist.org/packages/lsys/cache)[ RSS](/packages/lsys-cache/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (2)Used By (1)

缓存层抽象封装
=======

[](#缓存层抽象封装)

[![Build Status](https://camo.githubusercontent.com/aa753140a9251e2dfdf2327c091d3898e4b22c2107f66647e92fd3f681939686/68747470733a2f2f7472617669732d63692e636f6d2f7068702d6c7379732f63616368652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/php-lsys/cache)[![Coverage Status](https://camo.githubusercontent.com/4a251bbb0acee53451a97f0d0ed8db714a2e7c03bc253f4bc04caf675933f616/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7068702d6c7379732f63616368652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/php-lsys/cache?branch=master)

> 封装此类库是为了让业务逻辑的KEY-VALUE操作脱离具体的某个缓存服务,如:redis或其他,提升代码兼容性

使用示例:

```
//设置缓存使用配置,默认使用文件缓存
//不建议使用文件缓存,目前服务器很多性能都卡在磁盘IO上
\LSYS\Cache\DI::$config="cache.file";

```

```
$cache=\LSYS\Cache\DI::get()->cache();
// 设置缓存
var_dump($cache->set("a1231231df","b"));
// 获取缓存
var_dump($cache->get("a1231231df"));
// 判断缓存是否存在
var_dump($cache->exist("a1231231df"));
// 删除缓存
var_dump($cache->delete("a1231231df"));
// 删除所有缓存,注意:系统消耗大,不建议频繁调用
var_dump($cache->delete_all());

```

默认memcache 及redis 适配下已实现arithmetic及tags接口,可使用使用某key的自增减操作及按TAG操作缓存 关联数据设置缓存的时候会比较常用到,具体示例如下:

```
$cache=\LSYS\Cache\DI::get()->cache();
// 设置缓存,注意:通过tag_set设置数据通过get函数不可获取..
$tag=array('tag1');
var_dump($cache->tag_set("a1231231df","b",$tag));
// 获取缓存
var_dump($cache->tag_get("a1231231df"));
// 通过tag获取缓存
var_dump($cache->tag_find("tag1"));
// 通过tag删除某个缓存
var_dump($cache->tag_delete("tag1"));

```

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% 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

2234d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f1652fec3beae86de90c6615dd28be4729251e1b2bb08f1cd18e8193e6c4e48?d=identicon)[lsys](/maintainers/lsys)

---

Top Contributors

[![shanliu](https://avatars.githubusercontent.com/u/2927231?v=4)](https://github.com/shanliu "shanliu (20 commits)")[![php-lsys](https://avatars.githubusercontent.com/u/43031308?v=4)](https://github.com/php-lsys "php-lsys (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lsys-cache/health.svg)

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

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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