firewox/simple-memory-cache
Composer 安装命令:
composer require firewox/simple-memory-cache
包简介
Library for supporting any kind of in memory caching server using PSR-16 simple cache standard.
README 文档
README
Library for supporting any kind of in memory caching server using PSR-16 simple cache standard.
Getting Started
Use composer package manager to install Simple Memory Cache.
composer require firewox/simple-memory-cache
Prerequisites & configurations
This library requires at least PHP 7.1 to run. In your PHP file include composer autoload:
require_once 'vendor/autoload.php';
Structuring your code
Simple memory cache library attempts to abstract all the known in-memory cache server methods using a common interface. This library implements all the methods as defined in PSR 16 standard (https://www.php-fig.org/psr/psr-16/).
- Cache one item to memory using Redis
$redis = new Redis();
$status = $redis->set('test', 'hello world', 300);
- Get one item cached in memory using Redis
$redis = new Redis();
$value = $redis->get('test');
- Delete one item cached in memory using Redis
$redis = new Redis();
$value = $redis->delete('test');
- Cache multiple items to memory using Redis
$redis = new Redis();
$status = $redis->setMultiple(['test1' => 'hello', 'test2' => 'world'], 300);
- Get multiple items cached in memory using Redis
$redis = new Redis();
$values = $redis->getMultiple(['test1' => 'hello', 'test2' => 'world']);
- Delete multiple items cached in memory using Redis
$redis = new Redis();
$value = $redis->deleteMultiple(['test1', 'test2']);
统计信息
- 总下载量: 118
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-21