定制 herroffizier/yii2-ar-tag-cache 二次开发

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

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

herroffizier/yii2-ar-tag-cache

Composer 安装命令:

composer require herroffizier/yii2-ar-tag-cache

包简介

Yii 2 component for automatic cache invalidation invoked by ActiveRecord updates.

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage

Yii2 AR Tag Cache automatically invalidates tagged cache when ActiveRecord changes.

In fact it is a simple wrapper over Yii2's TagDependency. It creates special tag for ActiveRecord class and invalidates all cache marked by that tag when any of that class instances is being created, updated or deleted.

Installation

Install extension with Composer:

composer require "herroffizier/yii2-ar-tag-cache:@stable"

Attach behavior to AR model:

public function behaviors()
{
    return [
        'arCache' => [
            'class' => \herroffizier\yii2artc\Behavior::className(),
        ],
    ];
}

Usage

// Get tag dependency:
$dependency = $model->tagDependency;

// Attach dependency to cache:
Yii::$app->cache->set('cache', 'test', 0, $dependency);

// Now if you call save() or delete() for any instance of $model's class, cache will be invalidated.
// Also you may force cache invalidation without modifying models:
$model->invalidateCache();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-04-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固