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

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

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

bentools/cache

最新稳定版本:1.1

Composer 安装命令:

composer require bentools/cache

包简介

PSR-6 and PSR-16 Cache Adapters.

README 文档

README

Latest Stable Version License Build Status Coverage Status Quality Score Total Downloads

bentools/cache

Usage

Cache Fallback

If calling a cache method throws an exception, it will fall back to the other cache pool.

use BenTools\Cache\Fallback\CacheFallback;
use Cache\Adapter\Memcache\MemcacheCachePool;
use Cache\Adapter\Redis\RedisCachePool;

$main = new RedisCachePool(new Redis());
$default = new MemcacheCachePool(new Memcache());
$cache = new CacheFallback($main, $default);
$cache->get('foo'); // if $main->get('foo') throws an exception, will call $default->get('foo')

You can use as many cache pools as you want, so that a failing cache falls back to the next healthy one:

use BenTools\Cache\Fallback\CacheFallback;
use Cache\Adapter\Memcache\MemcacheCachePool;
use Cache\Adapter\Redis\RedisCachePool;
use Cache\Adapter\PHPArray\ArrayCachePool;

$redis = new RedisCachePool(new Redis());
$memcache = new MemcacheCachePool(new Memcache());
$arrayCache = new ArrayCachePool();
$cache = new CacheFallback($redis, $memcache, $arrayCache);
$cache->get('foo');

Installation

composer require bentools/cache

Tests

./vendor/bin/phpunit

License

MIT.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固