Spent last week polishing
yiisoft/cache. Now I think it looks good. It’s still based on original refactoring idea of @klimov-paul i.e. main
Cache class is a wrapper that takes any PSR-16 implementation as constructor argument and extends it with extra features.
Detailed readme is available. Compared to Yii 2:
- It’s PSR-16 compatible so both you can use any PSR-16 implementation and the library itself could be used as a PSR-16 implementation.
- Cache storage implementations are more polished.
- It has modern PHP types.
- Expression dependency was replaced with Callback dependency.
- Chain dependency was split into Any and All.
There are multiple things to decide on before release though:
clear()take key prefix into account?
- Do we need
addMultiple()? Are there use-cases for these?
- PSR-16 requires string keys but we’re supporting any types via serialization. Is this feature useful?
- Likely cache storage backends should be moved into separate repositories
Feedback is very welcome.