Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Capabilities as a read-only class #308

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

boesing
Copy link
Member

@boesing boesing commented Jun 13, 2024

Q A
Documentation yes
BC Break yes
QA yes

Description

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.

closes #8

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 laminas#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]>
@boesing boesing merged commit 1cbe3e6 into laminas:4.0.x Jun 14, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup capabilities
1 participant