Skip to content

2.12.0

Closed Jul 30, 2021 100% complete

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 Adap…

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 for StorageFactory#adapterFactory
  • StoragePluginFactoryInterface is a replacement for the StorageFactory#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 either laminas/laminas-mvc or mezzio/mezzio.

Fixed

  • CacheItemPoolDecorator#saveDeferred queued already expired cache items. This has been fixed and thus, the method will return false 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 as 0 as this is how adapters handle the increment/decrement when not used with the Serializer plugin.

Changed

  • The ExceptionInterface now extends the Throwable interface.
  • CallbackCache, ObjectCache and ClassCache simplified method calls by avoiding the usage of call_user_func* functions.
  • The PSR-16 decorator now uses the maximum 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 of StorageAdapterFactoryInterface and StoragePluginFactoryInterface.
  • 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 the PSR-16 decorator.

¹ Normalized array configuration example

[
    'adapter' => 'apcu',
    'options' => ['ttl' => 3600],
    'plugins' => [
        [
            'name' => 'exception_handler',
            'options' => [
                'throw_exceptions' => false,
             ], 
        ],
    ],
];

This milestone is closed.

No open issues remain. View closed issues or see open milestones in this repository.