Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cache utilities

Latest Stable Version Coverage Software License

This package provides small utilities for PSR cache implementations.

Installation

composer require cache/util:^1.0

Usage

The remember() helper reads a PSR-16 value or creates and stores it when the cache misses.

use function Cache\Util\SimpleCache\remember;

$result = remember(
    $cache,
    'report.monthly',
    3600,
    static fn () => buildMonthlyReport(),
);

Here, $cache implements Psr\SimpleCache\CacheInterface. The callback runs only when no cached value is available.

Contributing

Send pull requests to the main repository. Report issues on the GitHub issue tracker.

About

[READ ONLY] Util package for cache

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages