3.0.0
Release Notes for 3.0.0
laminas-cache
3.0.0 is here and finally enables projects to only require those cache adapters which are actually used by the project.
Please read more on how to migrate your project in our migration guideline.
Added
- Adds PHP 8.1 support to
laminas-cache
- PSR-6
CacheItemPoolDecorator
now validates the maximum key length - Each cache adapter now has to be implicitly required by a project
Removed
StorageFactory
andPatternFactory
were removedClassCache
pattern was removed while there is no alternative- Both
PatternCacheFactory
andStoragePatternCacheFactory
(introduced in v2.12.0) in order to provide forward compatibility for v3.0.0 are removed PatternPluginManager
andPatternPluginManagerFactory
were removed since most pattern require an underlying cache adapter which must now be passed via dependency injection rather than an option. Therefore, thePatternOptions
are not capable of thestorage
option anymore- The PluginManagerLookupTrait which was used to provide forward compatibility for the StorageAdapterFactoryInterface
Breaking Changes
CallbackCache
,OutputCache
andObjectCache
now require the underlying cache adapter (StorageInterface
) as 1st__construct
dependency. The options can be passed via 2nd__construct
argument but are optional.
Please note that it is not possible to inject the pattern configuration as an array anymore- Storage configurations must be in a specific shape. For more details, head to the release notes of 2.12.0
- All cache adapters are now marked as
final
and are not extensible anymore. In case that you are extending one of the cache adapters, please change your code ascomposition
should be preferred overinheritance
. For an example, please check out the composition over inheritance section. - Due to the enhancement of
CacheItemPoolDecorator
, the maximum key length for the underlying cache adapter is validated before it is passed to the adapter. - The
SerializationTrait
which was meant to be used by bothPSR-6
andPSR-16
decorators is now marked asinternal
. - The
PCRE_MAXIMUM_QUANTIFIER_LENGTH
constant of theSimpleCacheDecorator
(which was marked asinternal
) has now been moved to the new (alsointernal
)MaximumKeyLengthTrait
and thus had to become a public static property (as traits do not support constants).
All compatible satellite packages which do support laminas-cache
v3 can be found here.
3.0.0
- Total issues resolved: 3
- Total pull requests resolved: 22
- Total contributors: 4
BC Break,Enhancement
- 177: PSR-6 maximum cache key length validation thanks to @boesing
- 141: Mark plugin managers final thanks to @boesing
- 55: Remove all adapters from plugin manager thanks to @boesing
- 48: Support for PHP 8.0 thanks to @boesing
Enhancement
- 167: Removed old code related to deleted
ClassCache
pattern thanks to @boesing - 165: Support PHP 8.1 thanks to @boesing
- 163: Provide interface factory for
StorageAdapterFactoryInterface
thanks to @boesing - 144: Use dependency inversion for cache adapters thanks to @boesing
- 143: Remove dependency of cache adapters thanks to @boesing
- 79: Mark plugin manager objects final thanks to @boesing
- 67: Psalm thanks to @boesing
- 62: Specify cache storage adapters as suggestions rather than requirements thanks to @holtkamp
- 57: feat: introduce
StorageItem::setItems
forCacheItemPoolDecorator::commit
thanks to @boesing
Bug
- 164: PHP 8.1:
SimpleCacheDecorator#convertIterableToArray
converts float to integer array keys thanks to @boesing - 54: qa: bring back unit test for
AdapterOptions
thanks to @boesing - 53: qa: bring back unit test for
AbstractAdapter
thanks to @boesing
Documentation
- 148: Remove abandoned adapters v3 from documentation thanks to @boesing
- 60: Migration Guide for v3.0 thanks to @boesing
Documentation,Enhancement
- 145: Documentation for APCu adapter thanks to @boesing
- 142: Adds versioning for documentation thanks to @froschdesign
- 51: Fix documentation snippets thanks to @malukenho