nokitakaze/keyvalue

Key Value Storage

v0.1.6 2019-02-28 16:26 UTC

This package is auto-updated.

Last update: 2024-10-22 23:17:33 UTC


README

Current status

General

Build Status Scrutinizer Code Quality Code Coverage

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 Заменить