定制 fhteam/laravel-cache-redis-extended 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fhteam/laravel-cache-redis-extended

Composer 安装命令:

composer require fhteam/laravel-cache-redis-extended

包简介

Redis cache driver with extended capabilities

README 文档

README

This project is currently under development. Code most probably is broken. Please wait until 1.0 is released to use it in production.

Metrics _
Version PHP version
Compatibility Laravel compatibility Laravel compatibility
Quality Code Climate Build Status Coverage Status

Features:

  • All Cache facade methods extended to accept arrays as keys to utilize Redis MULTI operations (multi-get, -set, -forget etc.)
  • Redis optimized commands used where appropriate (EXISTS in has(), SET...NX in add() etc)
  • ❗ No need to do Cache::tags(...) when reading data. Cache::get() is enough. So you can now query cache without even knowing which tags are associated with some cache item
  • Tag operations optimized: there will be no second Redis query when doing Cache::tags() with the same tag set
  • Serialization support:
    • Built-in ability to serialize and deserialize Laravel models with all attributes and relations as a single cache item (Laravel cannot cache models, only queries upon which models are constructed. Each relation in Laravel currently is a separate query and thus a separate cache item)
    • Ability to add new serializers / deserializers for custom object types

Architecture

Core <===> Serialization <===> Encoding
 |                                 | 
 |---->  TagVersionStorage  <------|
 
          + Utility +
  • Core contains mostly Redis command implementations
  • Serialization handles packing and unpacking cache items into a structure, suitable to be placed into a cache (encoded item value, expiration data, item tags with their versions). Serialization relies on Coders to convert objects into something easily serializable.
    • Coders contain low-level serialization routes. They receive data (objects or whatever) and emit something, that can be passed to PHP's serialize() in order to get encoded object's representation. Every coder must implement CoderInterface
  • TagVersionStorage is a per-Redis-connection singleton, that manages tag versions: fetches actual tag versions, compares them, flushes them etc. All tag storage handlers should implement TagVersionStorageInterface.
    • PlainTagVersionStorage is a basic version of tag version storage that doesn't share any information about tag versions outside current PHP process. You can implement a version, that will store actual tag versions, for example, in APC if querying Redis becomes expensive or just needs to be avoided.
  • Utility contains some low-level specific tools which are not subsystem related.
    • RedisConnectionTrait - is a trait, that allows to reuse the same scheme of Redis connection handling across the project
    • Arr contains some low-level array routines
    • Time contains some time management routines

Contribute

  • Code style - Symfony 2
  • Use type hinting where possible
  • Use phpdoc annotations where possible
  • Prefer language constructs to strings (for example, use MyClass::class, not 'MyClass' where class name is needed)

fhteam/laravel-cache-redis-extended 适用场景与选型建议

fhteam/laravel-cache-redis-extended 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 39 次下载、GitHub Stars 达 8, 最近一次更新时间为 2015 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 fhteam/laravel-cache-redis-extended 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 fhteam/laravel-cache-redis-extended 我们能提供哪些服务?
定制开发 / 二次开发

基于 fhteam/laravel-cache-redis-extended 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-03-13