windomz/shmcache

轻量级、抽象、可扩展的即用型共享内存操作,利用PHP共享内存函数(shmop)。

v1.0.2 2017-06-29 14:29 UTC

This package is not auto-updated.

Last update: 2024-09-21 00:34:31 UTC


README

轻量级、抽象、可扩展的即用型共享内存操作,利用PHP共享内存函数(shmop)。

Latest Stable Version Build Status Minimum PHP Version

功能

  • shmop - 抽象可扩展 利用 shmop
  • Block - 键值对超时 实现
  • Cache - 扩展 Block轻量级即用型
  • 纯类,不依赖,除了开发模式测试

安装

在项目目录中打开终端

$ composer require windomz/shmcache

用法

shmcache 的设计理念是保持使用简单和 灵活性

提供函数的键值对,更多可扩展性和便利性。

<?php
use SHMCache\Block;
use SHMCache\Cache;

// Use by Block, extends \SHMCache\shmop
$memory = new Block;
$memory->save('key1', 'value1');
$memory->save('key2', 'value2');
echo $memory->get('key1');
echo $memory->get('key2');

// Or use by Cache, same as Block, can not need to new it.
Cache::saveCache('key1', 'value1');
Cache::saveCache('key2', 'value2');
echo Cache::getCache('key1');
echo Cache::getCache('key2');

开发

欢迎您的 Star,提交 pull request,报告错误,提出建议并讨论 shmcache

我非常愿意听到您对 shmcache 的看法,请访问 问题页面

许可

MIT