vakata/kvstore

A simple key-value storage class

2.0.2 2024-03-09 09:27 UTC

This package is auto-updated.

Last update: 2024-11-09 10:53:08 UTC


README

Latest Version on Packagist Software License

A simple key-value storage class. used for configurations and extended in vakata/session.

Install

Via Composer

$ composer require vakata/kvstore

Usage

$config = new \vakata\kvstore\Storage([ 'sample' => [ 'data' => 1] ]);
$config->get('sample.data', null, '.'); // 1
$config->set('sample.data', 2, '.'); // 2
$config->get('sample.data', null, '.'); // 2
$config->del('sample.data', '.'); // 2
$config->get('sample.data', null, '.'); // null
$config->get('sample.data', 'default', '.'); // "default"
$config->set('new.data.to.add', 2, '.'); // 2
$config->get('new.data', null, '.'); // [ 'to' => [ 'add' => 2 ] ]

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.