Skip to content
/ Util Public

[READ ONLY] Util package for cache

License

Notifications You must be signed in to change notification settings

php-cache/Util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cache Utilities

Gitter Latest Stable Version codecov.io Total Downloads Monthly Downloads Software License

This is a collection of utilities for the PSR-16 and PSR-6 caching standards.

Install

composer require cache/util

Use

use function Cache\Util\SimpleCache\remember;

$cache = new SimpleCache(); // some simple cache interface

// if the result exists at the key, it'll return from cache, else it'll execute the callback and store in cache and return.
$res = remember($cache, 'key', 3600, function() {
    return someExpensiveOperation();
});

Contribute

Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.