Download the PHP package rafalmasiarek/php-kv without Composer
On this page you can find all versions of the php package rafalmasiarek/php-kv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download rafalmasiarek/php-kv
More information about rafalmasiarek/php-kv
Files in rafalmasiarek/php-kv
Download rafalmasiarek/php-kv
More information about rafalmasiarek/php-kv
Files in rafalmasiarek/php-kv
Vendor rafalmasiarek
Package php-kv
Short Description Lightweight versioned key–value storage for PHP
License MIT
Package php-kv
Short Description Lightweight versioned key–value storage for PHP
License MIT
Please rate this library. Is it a good library?
Informations about the package php-kv
php-kv
Tiny versioned key-value manager for PHP.
Concepts
Scope + ID + Key ⇒ versioned value.
Think of:
scope– logical bucket, e.g."user","feature","tenant".id– identifier inside scope, e.g."123","acme".key– name inside that document, e.g."theme","feature_x_enabled".
Example:
Schema format
Internally each (scope, id) document is stored as JSON:
Schemas are managed in one place: Schema\SchemaRegistry.
SchemaRegistry::CURRENT– currently used schema id (e.g."v1").SchemaRegistry::DEFINITIONS– associative array of all supported schema versions.SchemaRegistrycontains helpers used byKVfor reading/updating documents and guarantees backwards compatibility: when you introduce"v2", old"v1"docs continue to work and can be upgraded or appended to.
To change schema:
- Add new entry in
SchemaRegistry::DEFINITIONS. - Update
SchemaRegistry::CURRENT. - Implement upgrade logic inside
SchemaRegistryif shape changes.
Storage backends
All backends implement Storage\StorageInterface:
Included:
FileStorage– JSON files on disk.RedisStorage– single key per document (kv:{scope}:{id}).MongoStorage– one document per(scope,id).
You can implement your own storage (e.g. SQL) by implementing this interface.
Installation
Minimal usage
All versions of php-kv with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package rafalmasiarek/php-kv contains the following files
Loading the files please wait ...