定制 pspychalski/phpcache 二次开发

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

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

pspychalski/phpcache

最新稳定版本:1.1.2

Composer 安装命令:

composer require pspychalski/phpcache

包简介

phpCache is object PHP >=5 cache wrapper that offers similar way of handling various caching mechanisms

README 文档

README

PhpCache is object PHP >=5 cache wrapper that offers similar way of handling various caching mechanisms:

  • APC (deprecated)
  • Memcached
  • Redis
  • Filesystem (deprecated)
  • Session (deprecated)
  • Variable (temporary, not available between requests)

#Example usage

require_once 'PhpCache.php';
\PhpCache\PhpCache::$sDefaultMechanism = 'Redis';
$cache = \PhpCache\Factory::getInstance()->create();

$key = new \PhpCache\CacheKey('myKey');
$cache->set($key, 'Lorem ipsum');
if ($cache->check($key)) {
    var_dump($cache->get($key));
} else {
    var_dump('Data not found');
}

#Methods available for all caching mechanisms:

  • set - sets cache value based on provided key
  • get - get data from cache based on provided key. Returns false when no data for key
  • check - checks if data for provided key is set
  • clear - removed data for key
  • clearAll - flushes cache

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-21