| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This refactors the cache configuration to follow Laravel's convention with a stores-based pattern, improving flexibility and consistency with other frameworks.
Changes:
- Restructured cache configuration with 'default' driver selection and 'stores' array
- Added support for CACHE_DRIVER environment variable
- Updated CacheManager::getDriver() to accept null and read from default config
- Changed config path from 'cache.{$name}' to 'cache.stores.{$name}'
- Simplified CacheManager::call() method signature with proper type hints
- Updated test configurations to match new structure
Benefits:
- More intuitive configuration structure
- Better alignment with Laravel's caching conventions
- Easier to manage multiple cache drivers
- Improved environment-based driver selection
Simplified the description for cache configuration changes in the changelog by removing reference to Laravel-style stores pattern.
There was a problem hiding this comment.
This PR refactors the cache configuration structure to be more consistent with other components like logging. The main change introduces a stores array to hold cache driver configurations, with a top-level default key that specifies which store to use by default. Backward compatibility is maintained through automatic migration logic in CacheManager.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/cache/src/CacheManager.php | Added backward compatibility migration logic and updated driver lookup to use cache.stores.* path |
| src/cache/tests/Cases/RedisDriverTest.php | Updated test configuration to use new stores structure |
| src/cache/publish/cache.php | Migrated publish configuration to new format with environment variable support |
| CHANGELOG-3.2.md | Added documentation of the breaking change with before/after examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This PR refactors the cache configuration structure to follow Laravel's convention with a stores-based pattern, improving flexibility and consistency with other modern PHP frameworks.
Changes
Configuration Structure (src/cache/publish/cache.php)
CacheManager Updates (src/cache/src/CacheManager.php)
Test Updates (src/cache/tests/Cases/RedisDriverTest.php)
Benefits
Migration Guide
Users need to update their config/autoload/cache.php file from:
To:
Test Plan