adammbalogh/key-value-store-replicator
Composer 安装命令:
composer require adammbalogh/key-value-store-replicator
包简介
Key-value replicator adapter.
README 文档
README
Description
This library provides a layer to replicate commands on key value stores.
All the read (get, getTtl, has) operations run only on the source adapter, others on both.
Check out the abstract library to see the other adapters and the Api.
Installation
Install it through composer.
{
"require": {
"adammbalogh/key-value-store-replicator": "@stable"
}
}
tip: you should browse the adammbalogh/key-value-store-replicator
page to choose a stable version to use, avoid the @stable meta constraint.
Usage
<?php use AdammBalogh\KeyValueStore\KeyValueStore; use AdammBalogh\KeyValueStore\Adapter\MemcachedAdapter; use AdammBalogh\KeyValueStore\Adapter\RedisAdapter; use AdammBalogh\KeyValueStore\Adapter\ReplicatorAdapter; $sourceAdapter = new MemcachedAdapter(new Memcached()); $replicaAdapter = new RedisAdapter(new Predis\Client()); $adapter = new ReplicatorAdapter($sourceAdapter, $replicaAdapter); $kvs = new KeyValueStore($adapter); $kvs->set('sample_key', 'Sample value'); $kvs->get('sample_key'); $kvs->delete('sample_key');
API
Please visit the API link in the abstract library.
Toolset
| Key | Value | Server |
|---|---|---|
| ✔ delete | ✔ get | ✔ flush |
| ✔ expire | ✔ set | |
| ✔ getTtl | ||
| ✔ has | ||
| ✔ persist |
Support
统计信息
- 总下载量: 31
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-21