cache/util

PSR-6 and PSR-16 Caching Utilities

Maintainers

Package info

github.com/php-cache/Util

Homepage

pkg:composer/cache/util

Transparency log

Statistics

Installs: 9 300

Dependents: 0

Suggesters: 0

Stars: 2

1.0.4 2026-08-20 02:14 UTC

This package is auto-updated.

Last update: 2026-08-20 02:28:43 UTC


README

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.