xes/pcache

此包最新版本(1.2)没有提供许可信息。

Predis 的包装器,用于添加 GetOrSet 功能

1.2 2015-06-20 19:05 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:49:16 UTC


README

安装

composer require xes/pcache

使用

require 'vendor/autoload.php';

$predis = new Predis\Client();
$cache = new xes\Pcache($predis);

$keyname = 'someKey';
$TTL = 60;

echo $cache->get($keyname, $TTL, function() {
	// Some slow function such as a database call
	sleep(1);
	return 'hello world';
});