2017 © Pedro Peláez
 

library shm

shared memory library of the php

image

inhere/shm

shared memory library of the php

  • Sunday, March 4, 2018
  • by inhere
  • Repository
  • 1 Watchers
  • 2 Stars
  • 110 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

php 共享内存

License Php Version Latest Stable Version, (*1)

php 共享内存操作的实现。基于, (*2)

  • sysvshm扩展:实现system v方式的共享内存 linux/mac
  • shmop扩展:共享内存操作扩展 linux/mac/windows

功能:, (*3)

  • 实现了共享内存的 写入 读取 删除 释放 基本操作
  • 扩展的类 ShmMap 实现了基于共享内存的数组结构(数组方式操作、pop/push、迭代器,读/取都会自动加锁)。

安装

  • composer
{
    "require": {
        "php-comp/shm": "dev-master"
    }
}
  • 直接拉取
git clone https://github.com/php-comp/shared-memory.git // github

使用


use PhpComp\Shm\ShmFactory; use PhpComp\Shm\ShmMap; $shm = ShmFactory::make([ 'key' => 1, 'size' => 512 ]); $shm->write('data string'); $ret = $shm->read(); var_dump($ret); $shmAry = new ShmMap([ 'key' => 2, 'size' => 512 ]); $shmAry['one'] = 'val1'; $shmAry['two'] = 'val2'; $shmAry->set('three', 'val3'); var_dump($shmAry['three'], $shmAry->getMap()); unset($shmAry['two']); var_dump($shmAry->getMap());

License

MIT, (*4)

The Versions

04/03 2018

dev-master

9999999-dev https://github.com/inhere/php-shared-memory

shared memory library of the php

  Sources   Download

MIT

The Requires

 

php library shared-memory

04/03 2018

v1.0.2

1.0.2.0 https://github.com/inhere/php-shared-memory

shared memory library of the php

  Sources   Download

MIT

The Requires

 

php library shared-memory

02/03 2018

v1.0.1

1.0.1.0 https://github.com/inhere/php-shared-memory

shared memory library of the php

  Sources   Download

MIT

The Requires

 

php library shared-memory