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']);
firewox/simple-memory-cache 适用场景与选型建议
firewox/simple-memory-cache 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 118 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 firewox/simple-memory-cache 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 firewox/simple-memory-cache 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 118
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-21