PHPackages                             qingbing/php-file-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/php-file-cache

ActiveLibrary[Caching](/categories/caching)

qingbing/php-file-cache
=======================

组件'file-cache' : 文件缓存的相关解析和操作

1.0.1(6y ago)022818MITPHP

Since Mar 16Pushed 6y agoCompare

[ Source](https://github.com/qingbing/php-file-cache)[ Packagist](https://packagist.org/packages/qingbing/php-file-cache)[ Docs](http://www.phpcorner.net)[ RSS](/packages/qingbing-php-file-cache/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (2)Used By (18)

php-file-cache
==============

[](#php-file-cache)

描述
--

[](#描述)

组件"file-cache" : 文件缓存的相关解析和操作，可以单独使用

注意事项
----

[](#注意事项)

- 缓存的参数配置参考 qingbing/php-config 组件
- 将缓存的"isWorking"设置成false，则缓存获取始终为"$default"
- 缓存的键名支持 字符串、数字、数组等可序列化的变量
- 缓存的键值支持 字符串、数字、数组等可序列化的变量
- 缓存支持批量的设置、获取、删除操作

使用方法
----

[](#使用方法)

```
        // 获取缓存实例
        $cache = FileCache::getInstance('file-cache');

        // ====== 普通用法 ======
        $key = "name";
        // 设置缓存
        $status = $cache->set($key, "ss");
        var_dump($status);
        // 获取缓存
        $name = $cache->get($key);
        var_dump($name);
        // 删除缓存
        $status = $cache->delete($key);
        var_dump($status);
        // 判断换成是否存在
        $status = $cache->has($key);
        var_dump($status);

        // ====== 批量用法 ======
        // 批量设置缓存
        $status = $cache->setMultiple([
            "name" => 'ss',
            "author" => [
                'qingbing',
                '10000',
            ],
        ]);
        var_dump($status);
        // 批量获取缓存
        $values = $cache->getMultiple(["name", "author"]);
        var_dump($values);
        // 批量删除缓存
        $status = $cache->deleteMultiple(["name", "author"]);
        var_dump($status);

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

        // ====== 清空缓存 ======
        // 清空命名空间换成
        $status = $cache->clear();
        var_dump($status);
```

====== 异常代码集合 ======
--------------------

[](#-异常代码集合-)

异常代码格式：1008 - XXX - XX （组件编号 - 文件编号 - 代码内异常）

```
 - 无

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity56

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

2251d 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 (5 commits)")

---

Tags

phpcachecachingfile cachefile cachingfilecache

### Embed Badge

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

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

###  Alternatives

[voku/simple-cache

Simple Cache library

322.5M7](/packages/voku-simple-cache)[rapidwebltd/rw-file-cache

RW File Cache is a PHP File-based Caching Library. Its syntax is designed to closely resemble the PHP memcache extension.

15191.3k7](/packages/rapidwebltd-rw-file-cache)[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)

PHPackages © 2026

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