Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.
/ cache-memcached Public archive

Framework agnostic PSR-16 SimpleCache Memcached adapter.

Notifications You must be signed in to change notification settings

soupmix/cache-memcached

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soupmix Memcached Cache Adaptor

Build Status Scrutinizer Code Quality Codacy Badge Code Climate Latest Stable Version Total Downloads Latest Unstable Version License composer.lock Code Coverage

Installation

It's recommended that you use Composer to install Soupmix Cache Memcached Adaptor.

$ composer require soupmix/cache-memcached "~0.3"

Connection

require_once '/path/to/composer/vendor/autoload.php';

$config = [
    'bucket' => 'test',
    'hosts'   => ['127.0.0.1'],
;
$handler = new Memcached($config['bucket']);
$handler->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
$handler->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
if (!count($handler->getServerList())) {
    $hosts = [];
    foreach ($config['hosts'] as $host) {
        $hosts[] = [$host, 11211];
    }
    $handler->addServers($hosts);
}

$cache = new Soupmix\Cache\MemcachedCache($handler);

Soupmix Memcached Cache API

See Soupmix Cache API