dev-master
9999999-dev https://github.com/msonnabaum/KeyValueStoreKeyValueStore Component
MIT
The Requires
- php >=5.3.3
The Development Requires
nosql keyvalue
Wallogit.com
2017 © Pedro Peláez
KeyValueStore Component
KeyValueStore is an abstraction layer for diverse key/value storage engines., (*1)
A simple usage example:, (*2)
use KeyValueStore\KeyValueStoreFactory;
// Define which collections are handled by which storage implementations.
$info = array(
'cache.boot' => 'KeyValueStore\Storage\MemcachedStorage',
'cache' => 'KeyValueStore\Storage\RedisStorage',
'default' => 'KeyValueStore\Storage\SqlStorage',
);
$factory = new KeyValueStoreFactory($info);
// This selects 'cache', since 'cache.common' is not specified.
$storage = $factory->get('cache.common');
// Store something.
$storage->set('foo', 'bar');
// Get it back.
$storage->get('foo');
// Store multiple key/value pairs.
$storage->setMultiple(array(
'bar' => 'baz',
));
// Get everything.
$storage->getAll();
To run the unit tests, install dev dependencies before running PHPUnit:, (*3)
php composer.phar install --dev
Run the unit tests with:, (*4)
phpunit
KeyValueStore Component
MIT
nosql keyvalue