Open slepic opened 4 years ago
Hi, thanks for great question.
We were in similiar position and wanted to give you option to upgrade packages as you can, one by one. That is why we left compatibility with 2.4, where possible.
But with Nette/Caching this was not that case. Difference is with types in 3.0. When we upgraded to Nette/Caching 3.0 we had to change signature of methods to comply with Nette.
For example this method https://github.com/Kdyby/Redis/blob/master/src/Kdyby/Redis/RedisStorage.php#L176 Has to have same typed arguments and return type as this Nette interaface. https://github.com/nette/caching/blob/master/src/Caching/IStorage.php#L33 When this change was implemented, RedisStorage wasn't compatible with Nette/Caching 2.4.
To resolve this you would have to make new RedisStorage implementation just for 2.4 with different types and implement this on your project. And this overhead just wasnt worth it.
To side note ~
can be more strict with minor versions, if needed. And in lot of cases it was better solution. But I am not strictly for this, if you know about package where ^
can be applied I dont have problem if you send PR.
Hi there,
I just wanted to ask what is the reason for this:
I mean why is nette/caching required in 3.0 while the others still allow 2.4/5?
We have a project with nette 2.4 (and still quite some work before we can move to 3.0). nette/database is on 2.4.8 which requires nette/caching ^2.2 which is then a conflict.
So my question is: Is nette/caching really needed in 3.0 or would ^2.4 be also acceptable? If it could work with 2.4, I would like to ask to change the composer.json accordingly.
As a side note, I want to point out the difference between
~
and^
in the versioning syntax and suggest that^
is preferred. I think we were actually having this discussion in some other kdyby package issue already...Just to provide a bigger picture. This conflict is preventing me right now from upgrading PHP to 7.4 prior to upgrading nette to 3.0. And i believe if nette/caching was required as
^2.4 || ^3.0
I could then upgrade PHP before nette. Question is whether kdyby/redis 5.0 can actualy work with nette/caching ^2.4?If you have no idea about the reasoning, I am willing to try it out on my own, but I'd first like to get some insight from you, guys.
Thanks in advance.