This repository is a simple abstraction layer for key-value caches. It implements PSR-16.
If you need a super-simply way to support PSR-16, sabre/cache helps you get started. It's as hands-off as possible.
It also comes with a test-suite that can be used by other PSR-16 implementations.
Make sure you have composer installed, and then run:
composer require sabre/cache
Read PSR-16 for the API. We follow it to the letter.
This is useful as a test-double or long running processes. The
only lasts as long as the object does.
$cache = new \Sabre\Cache\Memory();
This object uses the APCu api for caching. It's a fast memory cache that's shared by multiple PHP processes.
$cache = new \Sabre\Cache\Apcu();
This object uses the Memcached extension for caching.
$memcached = new \Memcached(); $memcached->addServer('127.0.0.1', 11211); $cache = new \Sabre\Cache\Memcached($memcached);
You are responsible for configuring memcached, and you just pass a fully
instantiated objected to the
Made at fruux
This library is being developed by fruux. Drop us a line for commercial services or enterprise support.