anime-db/shmop

Shmop is a simple and small abstraction layer for shared memory manipulation using PHP

Installs: 784

Dependents: 1

Stars: 1

Watchers: 1

Language: PHP

v1.0.4 2015-01-16 10:38 UTC

README

Latest Stable Version Latest Unstable Version Build Status Code Coverage SensioLabsInsight License

Shmop is a simple and small abstraction layer for shared memory manipulation using PHP

Installation

Add the following to the require section of your composer.json file:

"anime-db/shmop": ">=1.0"

Usage

Creating new block

use AnimeDb\Shmop\FixedBlock;

$sh = new FixedBlock(0xFF /* id for memory block */, 3 /* memory block size */);
$sh->write('foo');
echo $sh->read(); // print 'foo'
$sh->delete();

Reading an existing block

use AnimeDb\Shmop\FixedBlock;

$sh = new FixedBlock(0xFF, 3);
// print contents of memory block. if block is not exists prints a blank line
echo $sh->read();

License

This bundle is under the MIT license. See the complete license in the bundle: LICENSE