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

ActiveComposer

ice-php/cache
=============

缓存

067PHP

Since Dec 4Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

缓存
==

[](#缓存)

- 创建缓存对象

    $cache = cache('page')

    ```
      创建一个页面缓存对象

    ```

    $cache = cache('data')

    ```
      创建一个数据缓存对象

    ```

    $cache = cache('must')

    ```
      创建一个特指缓存对象

    ```

    $cache = cacheByType('mem')

    ```
      创建一个Memcache/Memcached缓存对象

    ```

    $cache = cacheByType('redis')

    ```
      创建一个redis缓存对象

    ```

    $cache = cacheByType('apc')

    ```
      创建一个apc缓存对象

    ```

    $cache = cacheByType('file')

    ```
      创建一个File缓存对象

    ```
- 配置信息

    system|cachePage

    ```
      指定页面缓存使用的类型:none|file|redis|mem|apc

    ```

    system|cacheData

    ```
      指定数据缓存使用的类型:none|file|redis|mem|apc

    ```

    system|cacheMust

    ```
      指定特指缓存使用的类型:none|file|redis|mem|apc

    ```
- 清除缓存

    clearAll()
- 创建指定类型缓存对象

    $cache = cacheFactory::createInstance(string $type)

    ```
      $type指定缓存使用的类型:none|file|redis|mem|apc

    ```
- 删除指定域的全部缓存数据

    $cache-&gt;clear(string $field = null):bool
- 存储缓存数据

    $cache-&gt;set(string $field, string $key, $data, int $expire = 0):bool
- 读取缓存数据

    $cache-&gt;get(string $key)
- 删除缓存数据

    $cache-&gt;delete(string $key):bool
- 判断缓存是否可用

    $cache-&gt;enabled():bool

    只有无缓存(NoneCache)是不可用的

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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://avatars.githubusercontent.com/u/148289317?v=4)[icePHP](/maintainers/icePHP)[@IcePHP](https://github.com/IcePHP)

---

Top Contributors

[![ice-php](https://avatars.githubusercontent.com/u/23303429?v=4)](https://github.com/ice-php "ice-php (19 commits)")

### Embed Badge

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

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

PHPackages © 2026

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