Skip to content

Latest commit

 

History

History
 
 

.docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Contributte PSR6 Caching

PSR-6 (Caching Interface) adapter for Nette Caching

Content

Setup

Install package

composer require contributte/psr6-caching

Register extension

extensions:
	psr6: Contributte\Psr6\DI\Psr6CachingExtension

Usage

Get ICachePoolFactory from DI

use Contributte\Psr6\ICachePoolFactory;

class MyClass
{

	/** @var ICachePoolFactory */
	private $cachePoolFactory;

	public function __construct(ICachePoolFactory $cachePoolFactory) {
		$this->cachePoolFactory = $cachePoolFactory;
	}

	private function doSomething(): void
	{
		$cachePool = $this->cachePoolFactory->create('namespace');
	}

}

Rest is in psr-6 documentation