gemini/cache 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gemini/cache

最新稳定版本:v0.3.0

Composer 安装命令:

composer require gemini/cache

包简介

Some Features for Hyperf Cache

关键字:

README 文档

README

PHPUnit

composer require gemini/cache

支持使用 this 获取当前实例的成员变量

配置映射关系,修改 dependencies.php

<?php

return [
    Hyperf\Cache\Aspect\CacheableAspect::class => Gemini\Cache\Aspect\CacheableAspect::class,
];

修改代码

<?php

use Hyperf\Cache\Annotation\Cacheable;

class UserService
{
    public $id = 1;

    /**
     * @Cacheable(prefix="test", value="#{this.id}")
     */
    function getCache()
    {
        return uniqid();
    }
}

$res = (new UserService())->getCache(); // 生成的缓存 KEY 为 test:1

使用 MD5 格式化缓存 KEY

配置映射关系,修改 dependencies.php

<?php

return [
    Hyperf\Cache\AnnotationManager::class => Gemini\Cache\AnnotationManager::class
];

再使用 Cacheable 注解时,KEY 值便会被转化为 prefix:md5 的格式。

统计信息

  • 总下载量: 1.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-05