vemcogroup/model-cache 问题修复 & 功能扩展

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

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

vemcogroup/model-cache

最新稳定版本:1.0.1

Composer 安装命令:

composer require vemcogroup/model-cache

包简介

Static cache instead of re-hitting cache server

README 文档

README

Latest Version on Packagist Total Downloads

Description

This package allows to have static local cache on your models.

It can both be used with a cache server or without.

Installation

You can install the package via composer:

composer require vemcogroup/model-cache

Usage

It's easy to use the trait in your own class just Use the trait as below

use Vemcogroup\ModelCache\Traits\HaslocalCache; class DataRepository { use HasLocalCache; public function getData($userId) { $localCacheKey = 'getData.'.$userId; /*  * If localCache exists with key return cache  */ if ($cache = self::getLocalCache($localCacheKey)) { return $cache; } // Run DB query or Cache code $result = [1, 2, 3, 4, 5, 6]; /*  * Remember to save your DB query or Cache result  */ self::setLocalCache($localCacheKey, $result); return $result; } }

If you need to clear the Cache you can use the clear method

self::clearLocalCache();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固