davidonium/simple-memcached

dev-master 2017-04-05 06:03 UTC

This package is not auto-updated.

Last update: 2025-05-30 23:03:29 UTC


README

A simple implementation of psr-16 simple-cache using the memcached extension.

For now the you can look at the tests for examples.

This is my first open source project, I will gladly accept any advice you can give me :).

TODO

  • Test ttl
  • Test multiple key actions on failure because invalid keys
  • Find out why keys using "\n\t\f" in double quoted php strings work and don't throw exception

Install

composer require davidonium/simple-memcached

Use

Create a test that looks like this:

$memcached = new \Memcached();
$memcached->addServer('127.0.0.1', '11211');
$cache = new \SimpleMemcached\SimpleMemcached($memcached);
$cache->set('lorem', 'ipsum');
$value = $cache->get('lorem'); // ipsum