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

ActiveLibrary[Caching](/categories/caching)

jlzan1314/swoft-cache
=====================

A cache component for swoft2.

1.10(6y ago)10183MITPHP

Since Jul 12Pushed 6y agoCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

感谢
--

[](#感谢)

本项目是基于hyperf/cache项目开发的,觉得不错,加上项目使用swoft2,就移植过来了

安装
--

[](#安装)

```
//install by composer
composer require jlzan1314/swoft-cache

```

用法
--

[](#用法)

#### 新group配置

[](#新group配置)

```
//bean.php

'cache.group2'=>[
    'class'=>\Jlzan1314\Cache\Group::class,
    'driver'=>bean("cache.driver"),
    'ttl'=>500,//默认的ttl
],
```

psr/simpleCache的使用方式
--------------------

[](#psrsimplecache的使用方式)

```
$cache=bean('cache');
```

和hyperf不同的地方
------------

[](#和hyperf不同的地方)

1.0 注解中 value="" 只支持#{0}替代,不支持具名替代#{id}

1.1 已经完全和hyperf一样了,需要swoft2.0.4

示列
--

[](#示列)

```
