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

ActiveLibrary

dcrphp/cache
============

缓存类

1.0.1(5y ago)01.1k1MITPHPPHP ^7.0

Since May 30Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dcrphp/cache)[ Packagist](https://packagist.org/packages/dcrphp/cache)[ RSS](/packages/dcrphp-cache/feed)WikiDiscussions master Synced 1w ago

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

缓存类说明
=====

[](#缓存类说明)

### 1、开启缓存:

[](#1开启缓存)

 enable=1
 driver=按下面的type来配置

### 2、type:

[](#2type)

 memcache,memcached,mongodb,php\_file,file,redis\_cluster,redis,sqlite,void,array
 redis\_cluster:要在composer.json中开启predis/predis
 void:空缓存，不想用缓存了，配置成这个
 redis:请在php.ini中开启phpredis组件
 sqlite:请在php.ini中开启sqlite3组件
 mongodb:请在php.ini中开启mongo组件

### 3、缓存配置：

[](#3缓存配置)

 参照example的cache.php，配置文件名请命名为cache.php

### 4、使用

[](#4使用)

```
$clsCache = new Cache();
//$clsCache->setConfig( array('enable' => 1, 'driver' => 'php_file') );
$clsCache->setConfigFile('cache.php');
$clsCache->init();
//设置
$clsCache->save('key', 'value', 0);
//获取
echo $clsCache->fetch('key');

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

2178d ago

### Community

Maintainers

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

---

Top Contributors

[![junqing124](https://avatars.githubusercontent.com/u/6613893?v=4)](https://github.com/junqing124 "junqing124 (4 commits)")[![dcrphp](https://avatars.githubusercontent.com/u/65381497?v=4)](https://github.com/dcrphp "dcrphp (1 commits)")

### Embed Badge

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

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

###  Alternatives

[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[contao-community-alliance/dc-general

Universal data container for Contao

1578.3k86](/packages/contao-community-alliance-dc-general)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1414.8k](/packages/pdir-social-feed-bundle)

PHPackages © 2026

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