kasseler/cache 问题修复 & 功能扩展

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

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

kasseler/cache

最新稳定版本:1.0.2

Composer 安装命令:

composer require kasseler/cache

包简介

Cache library

README 文档

README

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

Cache library. Implements different adapters.

Requirements

  • PHP >= 5.4
  • predis/predis ~1.0

Installation

$ composer require kasseler/cache

Usage

$cache = new Cache(new ArrayCache());
$cache->set('foo', [1,2,3,4,5]);
if ($cache->has('foo')) {
    var_export($cache->get('foo')->data());
}
$cache->drop();

Adapters

Array

$cache = new Cache(new ArrayCache());

Apc

$cache = new Cache(new ApcCache());

File

$cache = new Cache(new FileCache());

Memcache

$cache = new Cache(new MemcacheCache());

Memcached

$cache = new Cache(new MemcachedCache());

MongoDB

$cache = new Cache(new MongoDBCache());

Predis

$cache = new Cache(new PredisCache());

Redis

$cache = new Cache(new RedisCache());

Session

$cache = new Cache(new SessionCache());

SQLite3

$cache = new Cache(new SQLite3Cache());

Void

$cache = new Cache(new VoidCache());

Xcache

$cache = new Cache(new XcacheCache());

Speed testing

Test was conducted on php 5.6.

10K set 10K set 10K get 10K get 10K has 10K has
time, sec memory, Kb time, sec memory, Kb time, sec memory, Kb
Session 1,0591 5136,7890 104,262 11933,5893 68,2759 11933,5781
File 55,3532 19,90 11,2696 20,0781 1,9091 19,0937
Mongo 16,4049 19,3671 13,9658 20,3593 13,9008 19,375
Predis 2,2291 138,7343 2,1721 137,625 1,6831 133,1796
Redis 1,2731 27,1484 1,1151 27,1953 0,786 22,6562
Memcache 1,25 27,3359 1,8681 27,7890 0,814 23,1953
APC 0,9251 17,7265 1,1331 17,8046 0,441 13,226
Xcache 0,832 17,9140 0,9731 17,0468 0,439 13,4531
Void 0,147 17,3593 0,005 13,0390 0,174 13,1718

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-15