aichenk/kay-cache

psr-16 简单缓存实现

1.1.0 2020-04-16 02:22 UTC

This package is auto-updated.

Last update: 2024-10-16 12:05:56 UTC


README

符合psr-16 简单缓存类

运行环境

  • PHP 7.2+

安装方法

    composer require aichenk/kay-cache

使用

use KayCache\Cache;

$options = [
    'host'       => '127.0.0.1',
    'port'       => 11211,
    'lifetime'   => 3600,
    'prefix'     => '',
    'serialize' => 'php'  // php|json|igbinary|msgpack
];
$cache = Cache::memcache($options);

$cache->set('test', '111');
$data = $cache->get('test');

print_r($data);

$keys = $cache->queryKeys();
print_r($keys);

更新说明

2020-04-08

  • Add 支持queryKeys($prefix = '', bool $realKey = false)方法,获取key列表