adammbalogh/key-value-store-memcached

通过 memcached 扩展实现键值存储。

0.5.1 2014-10-20 17:38 UTC

This package is auto-updated.

Last update: 2024-08-29 02:04:48 UTC


README

Author Build Status Coverage Status Quality Score Software License Packagist Version Total Downloads

SensioLabsInsight

描述

此库提供了一层键值 memcached 存储。

它使用了 memcached 扩展。

查看 抽象库 了解其他适配器和 API。

安装

通过 composer 安装。

{
    "require": {
        "adammbalogh/key-value-store-memcached": "@stable"
    }
}

提示:您应浏览 adammbalogh/key-value-store-memcached 页面,选择要使用的稳定版本,避免使用 @stable 元数据约束。

使用方法

<?php
use AdammBalogh\KeyValueStore\KeyValueStore;
use AdammBalogh\KeyValueStore\Adapter\MemcachedAdapter as Adapter;

$memcachedClient = new Memcached();
$memcachedClient->addServer('localhost', 11211);

$adapter = new Adapter($memcachedClient);

$kvs = new KeyValueStore($adapter);

$kvs->set('sample_key', 'Sample value');
$kvs->get('sample_key');
$kvs->delete('sample_key');

API

请访问抽象库中的 API 链接。

工具集

支持

Support with Gittip