journey/cache

A simpler string cache interface than PSR-6.

1.1.0 2017-03-17 15:50 UTC

This package is not auto-updated.

Last update: 2024-04-13 23:51:41 UTC


README

Build Status Code Coverage Scrutinizer Code Quality

What

Journey cache is a very simple string caching interface. It is a much simpler alternative to the PSR-6 interface, and mostly useful for basic string cache. The interface comes bundled with a local file cache (LocalAdapter) and a memcached (MemcachedAdapter) implementation.

Interface

interface CacheAdapterInterface
{
    public function set($key, $value, $expiration = 0);
    public function get($key);
    public function delete($key);
    public function clear();
}

It's simple enough you can probably guess how to write your own adapters, but if you want more documentation, read the interface.

Note: The PSR-6 interface is fantastic, but sometimes you just don't need to be as verbose or robust as it requires. This fills that gap.