anime-db/shmop

Shmop 是一个使用 PHP 对共享内存进行操作的简单且小巧的抽象层

v1.0.7 2017-05-15 07:39 UTC

This package is auto-updated.

Last update: 2024-09-15 19:11:23 UTC


README

Latest Stable Version Latest Unstable Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality SensioLabsInsight StyleCI Dependency Status License

Shmop

Shmop 是一个使用 PHP 对共享内存进行操作的简单且小巧的抽象层

安装

使用 Composer 安装非常简单,运行

composer require anime-db/shmop

用法

创建新块

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();

读取现有块

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();

许可证

本软件包受 MIT 许可证 的保护。完整的许可证请见文件:LICENSE