PHPackages                             carler/php\_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. carler/php\_cache

ActiveLibrary[Caching](/categories/caching)

carler/php\_cache
=================

cache

07C++

Since Apr 4Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

php\_cache
==========

[](#php_cache)

composer php cache

\#使用方法:

\##1.下载

书写composer.json,内容如下:
{
 "require":{
 "carler/php\_cache":"dev-master",

"php" : "&gt;5.3.0"
},
"minimum-stability":"dev"
}

\##2.然后执行composer install

\##3.CarlerCache\\CCache($param,$cache\_type)

例子：

require 'vendor/autoload.php';
 use CarlerCache\\CCache;
 $config = \[
 'file' =&gt; \[
 'path' =&gt; '/tmp/'
 \]
\];
$cache = new CCache($config\['file'\],'file');
 $key = 'test';
$value = '12312312';
 $ttl = 3;
$ret = $cache-&gt;set($key, $value, $ttl);
 if ($ret != 0) {
 echo "set success, value is $value \\nttl is $ttl \\n";
 }
$ret = $cache-&gt;get($key);
 if (!empty($ret)) {
 echo "get success , value is $ret \\n";
 }
 $ret = $cache-&gt;delete($key);
 if (!file\_exists($config\['file'\]\['path'\] . $key)) {
 echo 'delete file success';
 }
redis参数：
$config = \[
 'redis' =&gt; \[
 'host' =&gt; '127.0.0.1',
 'port' =&gt; '9001',
 'select' =&gt; '0',
 'password' =&gt; 'redis123'
 \]
 \];
$cache = new CCache($config\['redis'\], 'redis');
 ssdb参数：
$config = \[
 'ssdb' =&gt; \[
 'host' =&gt; '127.0.0.1',
 'port' =&gt; '8888',
 'password' =&gt; '1234567890qwertyuiopasdfghjklzxcvbnm'
 \]
\];
 $cache = new CCache($config\['ssdb'\], 'ssdb');
 ###然后调用方式：
 $cache-&gt;get($key); //获取key值
 $cache-&gt;set($key, $val, $ttl);; //设置key 的value值 ttl是有效期 时间为秒，默认360s
$cache-&gt;delete($key) ; //删除key值

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc2391f3faf0bc7f4efca7be167900b4ca3d3423c70939df457ce9a4bea6da17?d=identicon)[carler\_czj](/maintainers/carler_czj)

---

Top Contributors

[![carler](https://avatars.githubusercontent.com/u/19358303?v=4)](https://github.com/carler "carler (11 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/carler-php-cache/health.svg)](https://phpackages.com/packages/carler-php-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)
