-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
[RFC]: PSR-16 (cache) compatibility #49
Comments
Right, because the caching features was added in 2012, before the PSR standard. 😉
Code and maintenance. The task for this component is not to create a compatibility layer, but to use available standards directly. |
In fact, PSR-16 would be more appropriate, as this component requires only simple get/set/delete cache operations. If you agree, I could rewrite the RFC description to replace PSR-6 by PSR-16. |
PSR-16 is a good choice for this package. 👍 |
Proposed design was not accepted (see #50 ). Another proposal using Decorators pattern have to be proposed. |
Closes laminas#49 Signed-off-by: Cédric Anne <[email protected]>
Closes laminas#49 Signed-off-by: Cédric Anne <[email protected]> Signed-off-by: Adrien Crivelli <[email protected]>
RFC
Goal
Change caching logic to be compatible with PSR-16.
Background
There is currently no way to use translation caching feature with a standardized cache component. Indeed, caching logic is only compatible with
laminas-cache
component.It could be interesting to make the cache logic compatible with PSR-16.
Considerations
Main impact would be a change in methods signatures.
It could be possible to maintain a compatibility with direct usage of
\Laminas\Cache\Storage\StorageInterface
instance, in order to prevent intoruction of BC break (and so propose this feature in a 2.12.0 version), but IMHO, it could be preferable to remove it, in order to keep the code simple.Proposal(s)
Laminas\I18n\Translator\Translator::factory()
options to accept onlyPsr\SimpleCache\CacheInterface
incache
entry.Laminas\I18n\Translator\Translator::setCache()
to acceptPsr\SimpleCache\CacheInterface|null
as$cache
argument.Laminas\I18n\Translator\Translator::getCache()
to returnPsr\SimpleCache\CacheInterface|null
.Psr\SimpleCache\CacheInterface
methods.The text was updated successfully, but these errors were encountered: