soupmix / cache-memcached
This package is abandoned and no longer maintained.
The author suggests using the soupmix/cache package instead.
Framework agnostic Memcached adapter for SimpleCache Interface.
0.3.3
2017-10-31 06:20 UTC
Requires
- php: >=5.6
- ext-memcached: *
- soupmix/cache-base: ~0.2
Requires (Dev)
- phpunit/phpcov: ^3.1.0
- phpunit/phpunit: ^5.4.0
- satooshi/php-coveralls: ~1.0
Provides
README
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);