psx/cache

PSR-6 implementation using the doctrine cache system

v1.0.0 2016-04-01 22:25 UTC

README

About

PSR-6 implementation using the doctrine cache system. Through theses classes it is possible to access the doctrine cache system through a PSR-6 interface.

Usage

<?php

$pool = new PSX\Cache\Pool(new Doctrine\Common\Cache\FilesystemCache());
$item = $pool->getItem('foo');

if (!$item->isHit()) {
    $value = doComplexTask();

    $item->set($value);
    $item->expiresAfter(3600);

    $pool->save($item);
} else {
    $value = $item->get();
}