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

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

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

vakata/cache

最新稳定版本:3.2.0

Composer 安装命令:

composer require vakata/cache

包简介

A collection of caching classes with a common interface

README 文档

README

Latest Version on Packagist Software License Build Status Code Climate Tests Coverage

A collection of caching classes with a common interface (currently file cache and memcached are supported).

Install

Via Composer

$ composer require vakata/cache

Usage

// create an instance (with file based cache)
// caches will be stored in the dir specified by the first argument
$cache = new \vakata\cache\Filecache(__DIR__ . '/cache'); 
// to use Memcached instead simply create a memcached instance:
// $cache = new \vakata\cache\Memcache(); // by default connects to 127.0.0.1

// simple get / set
$cache->set('key', 'value'); // key is stored and "value" is returned
$cache->get('key'); // "value"

// using prepare ensures that a single client updates the cache at any given moment
$cache->prepare('long-running-operation');
$data = long_running_operation();
$cache->set('long-running-operation', $data);

// there is a special getSet method which gets the current key value and if it does not exist - invokes a callable, stores the result and returns it:
$cache->getSet('some-key', function () {
    return some_long_running_operation();
});

Read more in the API docs

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

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