freedomsex/key-value-storage

此包已废弃,不再维护。作者建议使用 a4sex/key-value-storage 包。

基于PSR-6,Caching接口的简单键值存储。

v2.0.2 2020-09-27 19:13 UTC

This package is auto-updated.

Last update: 2023-04-03 13:41:40 UTC


README

基于PSR-6,Caching接口的简单键值存储。灵感来自 \Memcached()

# Symfony config cache.yaml

framework:
  cache:
    default_memcached_provider: 'memcached://'
    pools:
      memory:
        adapter: cache.adapter.memcached
        public: true
use FreedomSex\Services\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