sframe/memcache

memcache component

Installs: 10

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/sframe/memcache

dev-master 2014-12-04 13:50 UTC

This package is not auto-updated.

Last update: 2025-10-07 07:37:58 UTC


README

Memcache manager based on php_memcache extension Support multi memcache servers easier through configuration

Installation

composer require "sframe/memcache:dev-master"

Configuration

1 Server

array(
    'host' => '',       // optional, default 127.0.0.1
    'port' => '',       // optional, default 11211
    'persistent' => false, // optional, default false
    'weight' => 1,      // optional, default 1
    'expire' => 86400,  // optional, default 86400 (1 day)
)

Multi Servers

array(
    'servers' => array(
        array(...),
        array(...),
        ...
    ),
    'expire' => 86400
)

demo.php

$mc = new \SFrame\Memcache\Memcache();
$mc->set('hello', 1);
$mc->get('hello');
$mc->delete('hello');