nokitakaze / keyvalue
Key Value Storage
v0.1.6
2019-02-28 16:26 UTC
Requires
- php: ^5.6 | ^7.0.9
- ext-hash: *
- ext-pcre: *
- ext-posix: *
- nokitakaze/mutex: ^0.1.10
- psr/simple-cache: ~1.0.0
Requires (Dev)
- ext-json: *
- ext-reflection: *
- phpunit/phpunit: 5.5
README
Current status
General
Usage
At first
composer require nokitakaze/keyvalue
And then
require_once 'vendor/autoload.php'; // 1 $file_storage = new FileStorage([ 'folder' => '/dev/shm', ]); $file_storage->set('foo', 'bar'); echo $file_storage->get('foo', 'bar'); // 2 $file_storage = new FileStorage([ 'folder' => '/dev/shm', ]); $file_storage->set('foo', 'bar'); echo $file_storage->get('foo', 123); // 3 $redis_storage = new RedisStorage([ 'database' => 1, ]); $redis_storage->set('foo', 'bar'); echo $redis_storage->get('foo', 'default_value'); // @todo Заменить