viloveul / cache

Viloveul 缓存。使用 apcu 和 redisclient 实现 psr/simple-cache

维护者

详细信息

github.com/viloveul/cache

源代码

问题

安装次数: 164

依赖关系: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 0

开放问题: 0

类型:组件

v1.0.6 2019-06-06 19:24 UTC

This package is auto-updated.

Last update: 2024-09-07 07:42:31 UTC


README

确保你的 PHP 版本 > 7.0

composer require viloveul/cache

如何使用

require __DIR__ . '/vendor/autoload.php';

$adapter = new Viloveul\Cache\ApcuAdapter();
// or
// $adapter = new Viloveul\Cache\RedisAdapter($host, $port);

$adapter->setDefaultLifeTime(3600);

$adapter->setPrefix('secret_maybe');

$cache = new Viloveul\Cache\Cache($adapter);

$cache->set('hello', 'world');

var_dump($cache->get('hello', 'default_value'));