2017 © Pedro Peláez
 

library memory

some memory table tool library of the swoole

image

swoole-kit/memory

some memory table tool library of the swoole

  • Saturday, May 12, 2018
  • by inhere
  • Repository
  • 1 Watchers
  • 4 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

memory for swoole

swoole memory 工具的一些封裝, (*1)

快速方便的使用swoole server swokit/server, (*2)

主要包含有:, (*3)

  • 一个语言管理类
  • 内存表使用封装(除了基本的 get/set/del 增加了数据导出和恢复,简单的字段搜索)
  • 当使用多个内存表时,可以使用 MemoryDB 来管理
  • 一个使用swoole table的缓存类实现,PSR 16

install

composer require swokit/memory

内存表

  • Table使用共享内存来保存数据,在创建子进程前,务必要执行 Table->create()
  • swoole_server中使用Table,Table->create() 必须在 swoole_server->start() 前执行
$userTable = new MemoryTable('user', 1024);
$userTable->setColumns([
     'id' => [Table::TYPE_INT, 10],
     'username' => [Table::TYPE_STRING, 32],
     'password' => [Table::TYPE_STRING, 64],
]);

// create it
$userTable->create();

使用:, (*4)

$userTable->save('key', [
    'username' => 'tom',
    'password' => 'string',
]);

$row = $userTable->get('key');
$password = $userTable->get('key', 'password');

license

MIT, (*5)

The Versions

12/05 2018

dev-master

9999999-dev https://github.com/swoole-kit/memory

some memory table tool library of the swoole

  Sources   Download

MIT

The Requires

  • php >7.0.0

 

php library tool

06/05 2018

v1.0.0

1.0.0.0 https://github.com/swoole-kit/memory

some memory table tool library of the swoole

  Sources   Download

MIT

The Requires

  • php >7.0.0

 

php library tool