|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [1.0.0] - Unreleased |
| 9 | + |
| 10 | +### Added |
| 11 | +- **PSR-16 SimpleCache compliance** - Full implementation of `Psr\SimpleCache\CacheInterface` |
| 12 | +- `DateInterval` support for TTL values (PSR-16 standard) |
| 13 | +- `setMultiple()` method for batch setting (PSR-16) |
| 14 | +- `getMultiple()` method for batch retrieval (PSR-16) |
| 15 | +- `deleteMultiple()` method for batch deletion (PSR-16) |
| 16 | +- Simple key/value storage with SQLite |
| 17 | +- TTL support for automatic expiration |
| 18 | +- Atomic increment/decrement operations |
| 19 | +- Transaction support |
| 20 | +- WAL mode for better concurrency |
| 21 | +- Chunk processing for large datasets |
| 22 | +- Database statistics via `stats()` |
| 23 | +- Garbage collection for expired keys via `cleanExpired()` |
| 24 | +- `pull()` method for get-and-delete operation |
| 25 | +- Multiple examples demonstrating usage |
| 26 | +- Comprehensive documentation |
| 27 | + |
| 28 | +### Changed |
| 29 | +- **BREAKING**: `forget()` renamed to `delete()` (PSR-16 standard) |
| 30 | +- **BREAKING**: `flush()` renamed to `clear()` (PSR-16 standard) |
| 31 | +- **BREAKING**: `setMany()` renamed to `setMultiple()` (PSR-16 standard) |
| 32 | +- **BREAKING**: `many()` renamed to `getMultiple()` (PSR-16 standard) |
| 33 | +- `set()` now returns `bool` instead of `void` (PSR-16 compliance) |
| 34 | +- `delete()` now returns `bool` instead of `void` (PSR-16 compliance) |
| 35 | +- `clear()` now returns `bool` instead of `void` (PSR-16 compliance) |
| 36 | +- TTL parameter now accepts `int|DateInterval|null` instead of just `int|null` |
| 37 | + |
| 38 | +### Fixed |
| 39 | +- TTL handling with value 0 (now correctly treated as "already expired") |
| 40 | +- Optimized `has()` method to avoid unnecessary JSON decoding |
| 41 | +- Batch deletion of expired keys in `all()` method |
| 42 | + |
| 43 | +### Security |
| 44 | +- Table name sanitization to prevent SQL injection |
| 45 | +- Value size validation (max 10MB recommended) |
| 46 | +- Proper key validation in batch operations |
| 47 | + |
| 48 | +## Migration Guide from Pre-1.0 |
| 49 | + |
| 50 | +If you're upgrading from a pre-PSR-16 version, update your code as follows: |
| 51 | + |
| 52 | +```php |
| 53 | +// Before |
| 54 | +$cache->forget('key'); |
| 55 | +$cache->flush(); |
| 56 | +$cache->setMany(['key' => 'value']); |
| 57 | +$values = $cache->many(['key1', 'key2']); |
| 58 | + |
| 59 | +// After (PSR-16 compliant) |
| 60 | +$cache->delete('key'); |
| 61 | +$cache->clear(); |
| 62 | +$cache->setMultiple(['key' => 'value']); |
| 63 | +$values = $cache->getMultiple(['key1', 'key2']); |
| 64 | +``` |
| 65 | + |
| 66 | +All other methods (`get`, `has`, `increment`, `decrement`, `pull`, `all`, `keys`, `transaction`, `chunk`, `cleanExpired`, `stats`) remain unchanged. |
0 commit comments