CARVIEW |
soupmix / cache-memcached
Framework agnostic Memcached adapter for SimpleCache Interface.
Installs: 97
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/soupmix/cache-memcached
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
Suggests
None
Provides
Conflicts
None
Replaces
None
MIT a9cfe8df059e044c4963970d6a101d89c6254c1f
- Mehmet Korkmaz <mehmet.woop@mkorkmaz.com>
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);