承接 pessek/pessek_stash 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

pessek/pessek_stash

Composer 安装命令:

composer require pessek/pessek_stash

包简介

API for caching common counters to reduce DB queries

关键字:

README 文档

README

Elgg 4.0

API for caching common entity data to reduce DB queries

  • Caches entity likes count
  • Caches entity comments count
  • Caches last comment
  • Caches user friends count
  • Caches group members count

Developer Notes

Logic

The plugin uses preloader classes to load values from the database on first request. The value is cached and returned on consequent calls. Preloader::up() can be used to define when the cached value should be reset. For example, the value of likes is constant until a new like annotation is created, or an old is deleted, so we register our reset function for those events.

Helpers

You can use helper functions to retrieve counts using caching framework. All available shortcut functions can be found in /lib/functions.php

elgg_get_total_likes($entity);
elgg_get_total_comments($entity);
// etc.

Custom Properties

$stash = \hypeJunction\Stash\Stash::instance();

// Register a new cacheable property
$stash->register(new CustomProperty()); // Custom property must implement Preloader interface

// Get property value
$prop = $stash->get(CustomProperty::PROPERTY, $entity);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2021-11-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固