a4sex/key-value-storage

A simple key-value storage based on PSR-6, Caching Interface.

Installs: 983

Dependents: 3

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/a4sex/key-value-storage

v2.2.0 2023-09-03 12:15 UTC

This package is auto-updated.

Last update: 2025-10-01 00:13:40 UTC


README

A simple key-value storage based on PSR-6, Caching Interface. Inspired by \Memcached()

# Symfony config cache.yaml

framework:
  cache:
    default_memcached_provider: 'memcached://localhost'
    pools:
      memory:
        adapter: cache.adapter.memcached
        public: true
use A4Sex\KeyValueStorage;

// ...

public function __construct(KeyValueStorage $storage) 
{
    $this->storage = $storage;
}

// ...

$storage->save($key, $value, $expires = null);
$storage->load($key, $default = null);

////
// See source
////

// touch, item, clear
// [CounterStorage trait] increment, decrement, count