定制 kozz/yii-doctrine-cache 二次开发

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

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

kozz/yii-doctrine-cache

最新稳定版本:1.0.0

Composer 安装命令:

composer require kozz/yii-doctrine-cache

包简介

Doctrine Cache Factory for Yii 1

README 文档

README

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version Latest Unstable Version License

Proxy for Doctrine Cache in Yii

When to use

YiiDoctrineCache implements Doctrine\Common\Cache\Cache interface so it's fully compatible with all libraries that are requiring Doctrine Cache such as:

  • Doctrine Annotation Reader
  • Symfony Validator
  • JMS Serializer

How does it works

YiiDoctrineCache loads the most suitable Doctrine Cache Implementation in dependency of Yii Cache configuration:

  • Doctrine\Common\Cache\MemcachedCache
  • Doctrine\Common\Cache\MemcacheCache
  • Doctrine\Common\Cache\ArrayCache

Advantages

YiiDoctrineCache uses Proxy design pattern under the hood so you always have the same instance of Cache every time you call new YiiDoctrineCache() even if Doctrine's ArrayCache selected

//SomeFile.php
use Kozz\Yii1\Cache\YiiDoctrineCache;

$cache = new YiiDoctrineCache();
$cache->save('id', 'value');

//SomeOtherFile.php
use Kozz\Yii1\Cache\YiiDoctrineCache;

$cache = new YiiDoctrineCache();
$cache->fetch('id'); // 'value'

Reference

Methods

fetch($id) - Fetches an entry from the cache

contains($id) - Test if an entry exists in the cache

save($id, $data, $lifeTime = false) - Puts data into the cache

delete($id) - Deletes a cache entry

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-03