adammbalogh/key-value-store-replicator
Key-value replicator adapter.
Maintainers
Package info
github.com/adammbalogh/key-value-store-replicator
pkg:composer/adammbalogh/key-value-store-replicator
Requires
- php: >=5.4.0
- adammbalogh/key-value-store: ~0.5.1
Requires (Dev)
- adammbalogh/key-value-store-memory: 0.5.1
- mockery/mockery: ~0.9.2
- phpunit/phpunit: ~4.2.5
- satooshi/php-coveralls: dev-master
- squizlabs/php_codesniffer: ~1.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 8fa3cff8839efc40a598dea86c8259e49ca9fd66
- Adam Balogh <baloghbh.woop@gmail.com>
This package is auto-updated.
Last update: 2026-06-29 01:12:31 UTC
README
👁 Author
👁 Build Status
👁 Coverage Status
👁 Quality Score
👁 Software License
👁 Packagist Version
👁 Total Downloads
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 |
