adammbalogh/key-value-store-shared-memory

Key-value shared memory store through php shared memory module.

Maintainers

👁 adammbalogh

Package info

github.com/adammbalogh/key-value-store-shared-memory

pkg:composer/adammbalogh/key-value-store-shared-memory

Statistics

Installs: 1 107

Dependents: 0

Suggesters: 1

Stars: 3

Open Issues: 1

0.5.1 2014-10-20 19:28 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT dbda2eb5998bd30bb3ca65df5e2cce92bb31acc4

storememoryvaluekeysharedkey-valuekey-value-shared-memory

This package is auto-updated.

Last update: 2026-06-29 01:20:05 UTC


README

👁 Author
👁 Build Status
👁 Coverage Status
👁 Quality Score
👁 Software License
👁 Packagist Version
👁 Total Downloads

👁 SensioLabsInsight

Description

This library provides a layer to a key value shared memory store.

It uses the php shared memory module.

Check out the abstract library to see the other adapters and the Api.

Installation

Install it through composer.

{
 "require": {
 "adammbalogh/key-value-store-shared-memory": "@stable"
 }
}

tip: you should browse the adammbalogh/key-value-store-shared-memory page to choose a stable version to use, avoid the @stable meta constraint.

Usage

<?php
use AdammBalogh\KeyValueStore\KeyValueStore;
use AdammBalogh\KeyValueStore\Adapter\SharedMemoryAdapter as Adapter;

$tmpFileName = tempnam('/tmp', 'KVS');
$shmResource = shm_attach(ftok($tmpFileName, 'a'));
if ( ! $shmResource) {
 die('Unable to create the shared memory segment');
}

$adapter = new Adapter($shmResource);

$kvs = new KeyValueStore($adapter);

$kvs->set('sample_key', 'Sample value');
$kvs->get('sample_key');
$kvs->delete('sample_key');

API

Please visit the API link in the abstract library.

Toolset

Key Value Server
✔ delete ✔ get ✔ flush
✔ expire ✔ set
✔ getTtl
✔ has
✔ persist

Support

👁 Support with Gittip