https://github.com/gpslab/shmop
Shmop is a simple and small abstraction layer for shared memory manipulation using PHP
https://github.com/gpslab/shmop
Last synced: about 1 year ago
JSON representation
Shmop is a simple and small abstraction layer for shared memory manipulation using PHP
- Host: GitHub
- URL: https://github.com/gpslab/shmop
- Owner: gpslab
- License: mit
- Created: 2017-05-12T13:37:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-13T08:14:09.000Z (over 6 years ago)
- Last Synced: 2025-06-21T11:20:50.279Z (about 1 year ago)
- Language: PHP
- Size: 41 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/gpslab/shmop)
[](https://packagist.org/packages/gpslab/shmop)
[](https://travis-ci.org/gpslab/shmop)
[](https://coveralls.io/github/gpslab/shmop?branch=master)
[](https://scrutinizer-ci.com/g/gpslab/shmop/?branch=master)
[](https://insight.sensiolabs.com/projects/9b72d25e-8dca-4b71-a8a5-a1ec92050982)
[](https://styleci.io/repos/91094997)
[](https://github.com/gpslab/shmop)
# Shmop
Shmop is a simple and small abstraction layer for shared memory manipulation using PHP.

## Installation
Pretty simple with [Composer](http://packagist.org), run:
```sh
composer require gpslab/shmop
```
## Usage
Creating new block
```php
use GpsLab\Component\Shmop\Block;
$sh = new Block(
0xFF, // id for memory block
3 // memory block size
);
$sh->write('foo');
echo $sh->read(); // print 'foo'
$sh->delete();
```
Memory block must be a fixed size for correct reading from it.
Reading an existing block
```php
use GpsLab\Component\Shmop\Block;
$sh = new Block(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](http://opensource.org/licenses/MIT). See the complete license in the file: LICENSE