firehed / null-psr16
Always-offline PSR-16 cache implemention, for fallback and testing
Installs: 1 253
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 2
Requires
- php: ^8.0
- psr/simple-cache: ^1.0
Requires (Dev)
- phpstan/phpstan: ^0.12.46
- phpstan/phpstan-strict-rules: ^0.12.5
- phpunit/phpunit: ^9.3
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-11-10 00:33:51 UTC
README
This is a 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:
$cache = new \Firehed\Cache\NullPsr16(); // Use like any other PSR-16 implementation