cache/util

PSR-6 和 PSR-16 缓存工具

0.2.0 2022-01-12 20:25 UTC

This package is auto-updated.

Last update: 2024-09-17 14:42:29 UTC


README

Gitter Latest Stable Version codecov.io Total Downloads Monthly Downloads Software License

这是一个PSR-16和PSR-6缓存标准的工具集合。

安装

composer require cache/util

使用

use function Cache\Util\SimpleCache\remember;

$cache = new SimpleCache(); // some simple cache interface

// if the result exists at the key, it'll return from cache, else it'll execute the callback and store in cache and return.
$res = remember($cache, 'key', 3600, function() {
    return someExpensiveOperation();
});

贡献

非常欢迎贡献!向主仓库提交拉取请求,或向问题跟踪器报告您发现的问题。