psr/cache
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The PSR/Cache package provides a common interface for caching libraries in PHP. It's part of the PSR-6 Caching Interface which sets out standards for creating caching mechanisms in PHP. Notably, PSR/Cache does not contain its own caching implementation, but simply outlines the required structures to develop them.
PSR/Cache is typically employed through composer, the PHP package manager. To start using it, you first have to include it in your project with composer:
composer require psr/cache
After that, the PSR/Cache interfaces can be implemented inside your PHP code to build out your caching mechanisms according to PSR-6 standards.
Here's an example:
class MyCacheItem implements \Psr\Cache\CacheItemInterface {
// Implement all the required methods here according to PSR-6
}
class MyCachePool implements \Psr\Cache\CacheItemPoolInterface {
// Implement all the required methods here according to PSR-6
}
Please note that this package provides interfaces only, it's up to you as a developer to implement them in a way appropriate for your caching needs.
The PSR/Cache documentation resides in the PSR-6 document available at the PHP-FIG website: https://www.php-fig.org/psr/psr-6/. This document details the functionalities and obligations for each interface in the package.