vesica/cacher

此包已弃用且不再维护。未建议替代包。

基于php-cache构建的简化缓存库

1.4 2019-09-27 10:44 UTC

This package is auto-updated.

Last update: 2022-07-15 12:49:49 UTC


README

由于底层PHP Cache库现在已弃用,转而使用Symfony Cache (https://symfony.ac.cn/doc/current/components/cache.html),因此此库不再支持。Symfony cache简化了许多复杂性,就像此库所做的那样,没有很好的理由去维护另一个。

CircleCI Latest Stable Version Total Downloads License Monthly Downloads Daily Downloads composer.lock

缓存变得简单

这是一个PHP cache/cache库 (https://github.com/php-cache/cache) 的包装,只需2行代码即可简化缓存。

最初这是在 https://github.com/islamic-network/waf 内部编写的,但现在被用于各种项目中。

安装它

composer require vesica/cacher

使用Redis或Memcached

$cache = new \Vesica\Cacher\Redis($host, $port, $namespace);
// OR
$cache = new \Vesica\Cacher\Memcached($host, $port, $namespace);

$cache->set($key, $value);
$cache->get($key);
$cache->exists($key);