All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- 🐛 Lock resource handling - Fixed
TypeErrorinLock::release()when called multiple times (e.g., from__destruct()after manual release) - 🔧 PHPUnit compatibility - Downgraded PHPUnit from ^11.0 to ^10.0 for PHP 8.1 compatibility
- 🔧 PHPStan configuration - Updated deprecated config options (
checkMissingIterableValueType,checkGenericClassInNonGenericObjectType) - 🔧 PHPStan type errors - Fixed comparison type errors in
MultiTierCache::readThrough()with explicit int casts - 🔧 Code style violations - Fixed PSR-12 violations (trailing whitespace, line length)
- ♻️ MultiTierCache - Removed
finalkeyword to allow extension byEasyCachewrapper class - 📝 PHPUnit config - Updated schema to 10.5, disabled
failOnWarningto prevent CI failures from optional extension warnings - 📝 PHPStan config - Excluded
src/Laravelfolder (requires Laravel dependencies), added Predis ignore pattern for optional dependency
- ✅ Comprehensive test coverage (80%+ coverage)
- Unit tests for all storage backends
- Multi-tier caching tests
- SWR functionality tests
- Serialization and compression tests
- Key validation and lock mechanism tests
- 📚 Enhanced documentation
- Complete API reference (API.md)
- Practical examples guide (EXAMPLES.md)
- Contributing guidelines (CONTRIBUTING.md)
- Real-world use cases and patterns
- 🧪 Quality assurance tools
- PHPUnit configuration
- Composer scripts for testing and QA
- PHPStan baseline support
- 🛡️ Error handling across all components
- Proper exception handling in storage operations
- Detailed error logging with PSR-3 support
- Graceful degradation on failures
- Better error messages and diagnostics
- 🔒 ApcuStorage improvements
- Safe clear() that only removes prefixed keys
- Better APCu availability detection
- Improved error logging
- 📁 FileStorage improvements
- Better directory permission handling
- Improved error messages
- More robust file operations
- Better handling of concurrent access
- 🔴 RedisStorage improvements
- Type checking for Redis client
- Better connection error handling
- Improved SCAN implementation
- 💾 PdoStorage improvements
- Better BLOB handling for PostgreSQL
- Enhanced error messages
- Improved has() method with expiration check
- 🎯 MultiTierCache improvements
- Better lock directory management
- Enhanced logging throughout
- Improved error recovery
- Better documentation in code
- 🐛 Bug fixes in various storage backends
- 🔧 Fixed potential race conditions
- ✅ Improved validation and error handling
- 📝 Fixed typos and improved code documentation
- Full PSR‑16 implementation with multi‑key operations
- Multi‑backend tiers: APCu, Redis, File, PDO (MySQL/PostgreSQL/SQLite)
- Full SWR:
getOrSetSWR()with stale‑while‑revalidate and stale‑if‑error, non‑blocking per‑key locks, anddefermode - Pluggable Serializer/Compressor:
NativeSerializer&JsonSerializer;Null/Gzip/Zstd - Backfill: hits from lower tiers are written back to faster tiers
- Laravel Service Provider with auto‑discovery,
EasyCacheFacade, andconfig/easycache.php - Atomic file writes + read locks; directory sharding for file backend
- Record header upgraded to EC02; serializer and compressor names are stored for forward compatibility
- Minimum PHP version: 8.1+
- PSR SimpleCache version: 3.0
- Eliminated race conditions on file writes with
tmp + renameand read/write locks
See legacy documentation for v2.x changes.
- PHP Version: Now requires PHP 8.1+
- PSR-16: Updated to PSR SimpleCache 3.0
- Constructor:
EasyCacheconstructor changed to accept configuration array - Namespaces: All classes now under
Iprodev\EasyCachenamespace
Option 1: Use BC Wrapper (Recommended for quick migration)
// Old v2 code
use Iprodev\EasyCache\EasyCache;
$cache = new EasyCache([
'cache_path' => __DIR__ . '/cache',
'cache_extension' => '.cache',
'cache_time' => 3600,
'directory_shards' => 2,
]);
// Works the same way!
$cache->set('key', 'value');Option 2: Migrate to MultiTierCache
// New v3 code
use Iprodev\EasyCache\Cache\MultiTierCache;
use Iprodev\EasyCache\Storage\FileStorage;
use Iprodev\EasyCache\Serialization\NativeSerializer;
use Iprodev\EasyCache\Compression\NullCompressor;
$storage = new FileStorage(__DIR__ . '/cache', '.cache', 2);
$cache = new MultiTierCache(
[$storage],
new NativeSerializer(),
new NullCompressor(),
3600
);
// Same API
$cache->set('key', 'value');- Multi-tier caching:
$cache = new MultiTierCache([
new ApcuStorage(),
new RedisStorage($redis),
new FileStorage('/cache')
]);- SWR pattern:
$data = $cache->getOrSetSWR(
'key',
fn() => expensiveOperation(),
300, // TTL
60, // SWR
600 // Stale-if-error
);- Compression:
$cache = new MultiTierCache(
[$storage],
new NativeSerializer(),
new GzipCompressor(5)
);Special thanks to all contributors who helped improve PHP EasyCache!
- Error handling improvements
- Test coverage additions
- Documentation enhancements
- Bug fixes and performance optimizations
See CONTRIBUTORS.md for the full list.