cache / util
PSR-6 and PSR-16 Caching Utilities
Installs: 9 295
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
pkg:composer/cache/util
Requires
- php: >=7.4
- psr/cache: ^1.0 || ^2.0
Requires (Dev)
- cache/array-adapter: ^1.0
- phpunit/phpunit: ^7.5.20 || ^9.5.10
This package is auto-updated.
Last update: 2025-09-17 16:37:30 UTC
README
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.