Skip to content

Repository files navigation

PSR-6 Doctrine bridge

Latest Stable Version Coverage Software License

This package adapts a PSR-6 cache pool to the legacy Doctrine\Common\Cache\Cache API.

Installation

composer require cache/psr-6-doctrine-bridge:^4.0

Usage

use Cache\Bridge\Doctrine\DoctrineCacheBridge;

$cacheProvider = new DoctrineCacheBridge($pool);

$cacheProvider->contains($key);
$cacheProvider->fetch($key);
$cacheProvider->save($key, $value, $ttl);
$cacheProvider->delete($key);

$cacheProvider->getCachePool();

$pool must implement Psr\Cache\CacheItemPoolInterface from psr/cache 3.x.

The bridge keeps legacy normalized keys when the pool accepts them. If the pool rejects a key, the bridge retries with a 64-character SHA-256 key.

Contributing

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

About

[READ-ONLY] PSR-6 Doctrine Bridge

Resources

Stars

15 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages