2.12.0
Release Notes for 2.12.0
Feature release (minor)
This release focuses on providing forward compatibility to the next major release of this component.
With laminas/laminas-cache
v3, using static factories for the adapters won't be possible anymore as this component wont be aware of which storage adapters are around.
All storage adapters will have to populate themselves to the AdapterPluginManager
.
Instead of using the StorageFactory
(which is marked as deprecated in this release), the StorageAdapterFactory
(StorageAdapterFactoryInterface
) should be used. It provides StorageAdapterFactoryInterface#createFromArrayConfiguration
which consumes the exact same (normalized¹) configuration as StorageFactory#factory
.
There are also replacements for the other methods of the StorageFactory
:
StorageAdapterFactoryInterface#create
is a replacement forStorageFactory#adapterFactory
StoragePluginFactoryInterface
is a replacement for theStorageFactory#pluginFactory
To verify that your projects configuration is compatible with the new normalized¹ configuration, you can use laminas/laminas-cli with the CLI command laminas-cache:deprecation:check-storage-factory-config
.
Added
- Added a
laminas-cli
command to check project configuration for deprecated storage configuration. - Added a
StorageAdapterFactoryInterface
which is retrievable via the PSR-11 container when this component is used with eitherlaminas/laminas-mvc
ormezzio/mezzio
.
Fixed
CacheItemPoolDecorator#saveDeferred
queued already expired cache items. This has been fixed and thus, the method will returnfalse
for cache items which are already expired.Serializer
plugin treated non-existent cache items as an error and thus did not incremented/decremented these values. Non-existent values must be treated as0
as this is how adapters handle the increment/decrement when not used with theSerializer
plugin.
Changed
- The
ExceptionInterface
now extends theThrowable
interface. CallbackCache
,ObjectCache
andClassCache
simplified method calls by avoiding the usage ofcall_user_func*
functions.- The
PSR-16
decorator now uses themaximum key length
capability to better reflect the PSR requirements.PSR-16
requires that the backend supports at least 64 characters but it may also allow more than 64 characters.
Deprecated
- Deprecated
StorageFactory
in favor ofStorageAdapterFactoryInterface
andStoragePluginFactoryInterface
. - Deprecated some storage configurations to normalize¹ the configuration for the
StorageAdapterFactoryInterface
. - Deprecated the usage of storage adapters which do not provide the
maximum key length
capability in combination with thePSR-16
decorator.
¹ Normalized array configuration example
[
'adapter' => 'apcu',
'options' => ['ttl' => 3600],
'plugins' => [
[
'name' => 'exception_handler',
'options' => [
'throw_exceptions' => false,
],
],
],
];
2.12.0
- Total issues resolved: 6
- Total pull requests resolved: 12
- Total contributors: 4
Bug
- 135: Bugfix: Serializer should treat non-existent items as
0
when incrementing/decrementing items thanks to @boesing - 134: Bugfix: Expired cache items must not be queued for later persistence thanks to @boesing
- 112: PSR-16 decorator should use maximum key length capability thanks to @boesing and @weierophinney
Enhancement
- 120: qa: normalize plugin tests thanks to @boesing
- 113: Remove
\Exception
fallback for PSR-16 decorator thanks to @boesing - 109: Extend Throwable in ExceptionInterface thanks to @ghostwriter
- 105: Remove file headers thanks to @ghostwriter
- 104: Normalize
StorageFactory
options thanks to @boesing - 80: Normalize adapter configuration thanks to @boesing
- 63: CallbackCache: simplify calling function/method thanks to @marc-mabe