psr-discovery/cache-implementations
Discovers installed PSR-6 cache implementations at runtime and returns the first available adapter, avoiding hard dependencies in libraries/SDKs. Supports php-cache adapters and Stash, with options to prefer or manually instantiate configurable caches.
The package (psr-discovery/cache-implementations) bridges PSR-16 cache interfaces with Laravel’s caching layer, improving compatibility with external cache backends (e.g., Redis, Memcached) while maintaining Laravel’s native Cache facade. The expanded support for laminas/laminas-cache (v4.0) and neos/cache (v5.0–v8.0) aligns with modern PHP ecosystems, reducing vendor lock-in for teams using these libraries. The PHP 8.2 minimum requirement ensures compatibility with Laravel’s latest LTS (v10.x+) and avoids legacy overhead.
Cache contract, requiring minimal changes to existing implementations. The PSR-16 focus ensures interoperability with Laravel’s Cache::store() and Cache::driver() methods.| Risk Area | Assessment |
|---|---|
| Breaking Changes | Low: PHP 8.2 is a minor version bump, but Laravel 9.x projects will need upgrades. |
| Dependency Conflicts | Medium: laminas/laminas-cache v4.x and neos/cache v5.0+ may conflict with older Laravel packages (e.g., predis/predis < v2.0). Test thoroughly. |
| Performance | Neutral: PSR-16 abstractions add negligible overhead; backend performance depends on the cache driver. |
| Security | Low: No direct security changes, but PHP 8.2 includes security fixes. |
laravel/framework, predis/predis)?laminas/laminas-cache or neos/cache? If so, what versions are currently deployed, and how will the upgrade path be tested?predis/predis < v2.0).composer.json to include the new package version (^1.2.0).laminas/laminas-cache and neos/cache to supported versions (v4.0+ and v5.0–8.0, respectively).config/cache.php drivers (e.g., redis, memcached) are configured correctly.Cache::store() and Cache::driver() calls with the new implementations.laminas/laminas-cache v4.x API changes).Cache contract, so no changes to core Laravel files are needed.1.1.1 if issues arise, with a fallback to Laravel’s native cache drivers.laminas/laminas-cache and neos/cache for breaking changes in minor releases.composer.json if using neos/cache to avoid unexpected upgrades.Cache::getStore()->getHandler() to inspect the underlying cache handler if debugging is needed.laminas/laminas-cache and neos/cache issues may require coordination with their respective teams.| Scenario | Mitigation Strategy |
|---|---|
| Cache Backend Unavailable | Implement a fallback cache driver (e.g., file) in config/cache.php. |
| PHP 8.2 Upgrade Issues | Test with a staging environment mirroring production. Use php -v and composer validate checks. |
| Package Conflicts | Isolate dependencies in composer.json (e.g., replace constraints). |
| Race Conditions | Use Cache::lock() for critical sections if high concurrency is expected. |
Cache::remember(), Cache::put()).Cache facade.How can I help you explore Laravel packages today?