Closed basz closed 6 years ago
All these middlewares are already ported to psr-15 here: https://github.com/middlewares/psr15-middlewares So it's not needed to use this compatibility library.
If I'm not mistaking, unless an application itself (or one of its other dependencies) depends on an older version of psr15...
Most middlewares have been ported to psr-15 when it was v0.2 and updated with the new versions. For example, in the changelog of https middleware: https://github.com/middlewares/https/blob/master/CHANGELOG.md you can see it was compatible with many versions:
http-middleware v0.2
http-middleware v0.3
http-middleware v0.4
http-middleware v0.5
So, if you want to use a specific version of psr-15, a good idea is not specify a version of these middlewares. For example, to use v0.3:
{
"require": {
"http-interop/http-middleware": "^0.3",
"middlewares/https": "*",
"middlewares/trailing-slash": "*"
}
}
So, composer should be able to choose the correct version of each middleware.
That would work. But you would need to release patches for each 0. version if a bug is found. The compat layer could be implemented in each middlewares/
Yes, that's true. My point is this people could use this compat layer to use old middlewares within the newest standard. Anyway, this requires to change +40 packages to use this layer and, honesty, I don't have the time (nor the interest) of doing that. This is a short-term solution and I prefer to wait a bit more for the final release of PSR-15 (that I hope it will be soon). I could use this layer if it were available at the begining, before port all these middlewares to individual and psr-15 compatible packages.
I totally understand. It think is’n that relevnt now you have split the repo. More useful for frameworkish libraries. Thanks
To decouple from a specific version of http-interop/http-middleware which is likely to BC until released you could use https://github.com/webimpress/http-middleware-compatibility
I have implemented into several packages and it works great. We already use it in prooph and PR's for zendframework are coming.