graymatterlabs/simple-cache

PSR-16 implementations

v1.1.4 2023-02-28 04:43 UTC

README

Latest Version on Packagist Tests Total Downloads

Runtime implementations that satisfy the PSR-16 specification. Currently supported are array, "null-object", and cookie-based implementations.

Installation

You can install the package via composer:

composer require graymatterlabs/simple-cache:^1.1

Usage

$cache = new ArrayCache(); // new CookieCache('cookie-name');

$cache->set($key, $value, $ttl); // bool
$cache->setMultiple($values, $ttl); // bool
$cache->get($key, $default); // $value|$default
$cache->getMultiple($keys, $default); // iterator|$default
$cache->delete($key); // bool
$cache->deleteMultiple($keys); // bool
$cache->has($key); // bool
$cache->clear();

Testing

composer test

Changelog

Please see the Release Notes for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.