jdodds / key-value-file
a simple file-backed persistent key-value store
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jdodds/key-value-file
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2026-02-14 22:32:47 UTC
README
This is a very simple file-backed persistent key-value store for php.
Usage:
$store = new JDodds\Storage\KeyValueFile('/path/to/save/in');
$store->attach('foo', 'bar');
$store['baz'] = 'quux';
$store->persist();
// ... sometime later
$store = new JDodds\Storage\KeyValueFile('/the/same/path/as/before');
$foo = $store['foo'];
$foo2 = $store->detach('foo');
$store->contains('foo') // false;