承接 flatphp/memstore 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flatphp/memstore

Composer 安装命令:

composer require flatphp/memstore

包简介

memory storage component

README 文档

README

Memcache, Memcached, Redis, RedisCluster, Predis

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',
           ......
      )
  )

统计信息

  • 总下载量: 90
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 8
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固