https://github.com/firehed/php-null-psr16
PSR-16 no-op cache (for fallbacks and testing)
https://github.com/firehed/php-null-psr16
Last synced: 4 months ago
JSON representation
PSR-16 no-op cache (for fallbacks and testing)
- Host: GitHub
- URL: https://github.com/firehed/php-null-psr16
- Owner: Firehed
- License: mit
- Created: 2021-06-02T23:15:51.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T23:49:36.000Z (almost 2 years ago)
- Last Synced: 2025-01-18T22:40:11.374Z (over 1 year ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSR-16 "null driver"
This is a [PSR-16](https://www.php-fig.org/psr/psr-16/) implementation that always fails.
The motivation for this to exist is for fallback handling in cascading cache drivers.
Rather than the application using a cache failing entirely because it can't connect to the cache, it can fall back to a non-throwing implementation like this.
Also useful for tests where you want to ensure correct non-throwing failure handling and don't want to write a mock driver.
## Installation and Usage
Install: `composer require firehed/null-psr16`
Usage:
```php
$cache = new \Firehed\Cache\NullPsr16();
// Use like any other PSR-16 implementation
```