2017 © Pedro Peláez
 

library memstore

memory storage component

image

flatphp/memstore

memory storage component

  • Wednesday, April 12, 2017
  • by fredyang
  • Repository
  • 1 Watchers
  • 1 Stars
  • 43 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Memstore

Memcache, Memcached, Redis, RedisCluster, Predis, (*1)

Installation

composer require "flatphp/memstore"

Usage

use Flatphp\Memstore\Conn;

// single
Conn::init(array(
    'memcache' => ['host' => '127.0.0.1', 'port' => 11211],
    'memcached' => ['host' => '127.0.0.1', 'port' => 11211],
    'redis' => ['host' => '127.0.0.1', 'port' => '6379'],
    'redis_cluster' => ['seeds' => ['host1:7001', 'host2:7002']],
    'predis' => ['host' => '127.0.0.1', 'port' => '6379'],
));

$memcache = Conn::getMemcache();
$memcached = Conn::getMemcached();
$redis = Conn::getRedis();
$redis_cluster = Conn::getRedisCluster();
$predis = Conn::getPredis();

$redis->set('test', 1);
......

Configuration

Memcache

  // single:
  array(
      'host' => '127.0.0.1',  // required
      'port' => 11211,  // required
      'persistent' => true,
      'weight' => 1,
      # 'timeout' => 1,
      # 'retry_interval' => 15,
      # 'status' => true,
      # 'failure_callback' => null
  )

  // multi:
  array(
      array('host' => 'host1', ......),
      array('host' => 'host2', ......)
  )
......

Memcached

  array(
      'options' = [],
      'persistent_id' => 'mc',
      'host' => 'localhost', // required
      'port' => 11211, // required
      'weight' => 0
  )

  array(
      'options' = [],
      'persistent_id' => '',
      array('host' => 'host1', 'port' => 11211, 'weight' => 1),
      array('host' => 'host2', 'port' => 11211, 'weight' => 1)
  )

Redis

  array(
      'options' => [],

       'host' => '127.0.0.1',  // required
       'port' => '6379',  // required
       'password' => 'xxx',
       'persistent' => false,
       'database' => 0,
       'timeout' => 0
  )

RedisCluster

  array(
      'options' => [],
      //'name' => 'mycluster'
      'seeds' => ['host1:7000', 'host2:7001'] // name or seeds is required
      'timeout' => 0,
      'read_timeout' => 0,
      'persistent' => false
  )

Predis

  array(
      'options' => [],
       'host' => '127.0.0.1',
       'port' => '6379',
       'password' => 'xxx',
       'persistent' => false,
       'database' => 0,
       'timeout' => 0
  )

  array(
      'options' => [],
      array(
           'host' => '127.0.0.1',
           'port' => '6379',
           'password' => 'xxx',
           'persistent' => false,
           'database' => 0,
           'timeout' => 0
      ),
      array(
           'host' => '127.0.0.1',
           ......
      )
  )

The Versions

12/04 2017

dev-master

9999999-dev

memory storage component

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Fred Yang

redis memcache predis memcached redis cluster memstore

12/04 2017

v2.0.1

2.0.1.0

memory storage component

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Fred Yang

redis memcache predis memcached redis cluster memstore

01/04 2017

v1.0

1.0.0.0

memory storage component

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Fred Yang

redis memcache memstore

01/04 2017

v1.0.0

1.0.0.0

memory storage component

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Fred Yang

redis memcache memstore