You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: provide Capabilities as a read-only class
This also removes `capability` event and the `marker` object. Capabilities are meant to be read-only and thus won't change after retrieval via `StorageInterface#getCapabilties`.
By having the event deleted, there is no need to have the adapter injected, though we also removed `Capabilities#getAdapter` and the `StorageInterface` constructor argument.
By refactoring the `Serializer` plugin, which already replaced the initial instance of `Capabilities`, we were able to drop the `base capabilities` feature as well.
Final result is that we now provide all capabilities as public `read-only` properties which reflect their defaults which were previously handled via internal `$default` magic in `Capabilties#getCapability`.
Along all the refactoring, some capabilities have changed or were removed while respecting ideas of #8 which was around since 2016:
- `staticTtl` got removed without a replacement. It outlined if the cache backend is handling cache expiry or if the implementation is taking care of it. Though it might be interesting for picking a specific backend, that is rather not of interest at runtime for upstream projects.
- `lockOnExpire` got removed without a replacement. Was only used in zend-server adapter which is already abandoned since 2022
- `minTtl` got renamed to `ttlSupported` and its type changed from `int` to `bool`
- `maxTtl` got removed without a replacement. Every cache backend which is supported by laminas right now does allow TTLs being an infinite amount of seconds (where maximum `int` range is the limit, depending on the CPU architecture). There was a backend `XCache` where a limit existed but that backend was abandoned in 2021.
- `useRequestTime` was renamed to `usesRequestTime`
- `namespaceSeparator` got removed without a replacement. It was reflecting the option value and this the storage options can be used instead.
Signed-off-by: Maximilian Bösing <[email protected]>
0 commit comments