FriendsOfSymfony / FOSHttpCache

Integrate your PHP application with your HTTP caching proxy
https://foshttpcache.readthedocs.io
Other
353 stars 60 forks source link

`php-http/message-factory` is abandoned #555

Closed mvhirsch closed 7 months ago

mvhirsch commented 9 months ago

Hey :-)

One of my projects is using friendsofsyfmony/fos-http-cache-bundle. I recently noticed composers output:

Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.

Obviously this got abandoned: https://packagist.org/packages/php-http/message-factory

What should be the next step? I'm new to HTTPlug and PSR17, but I'm eager to learn.

dbu commented 9 months ago

indeed we should switch to PSR-17 (and PSR-18 with php-http/discovery for autoconfiguration if desired).

as we have the not yet released 3.x branch, this is the perfect moment for changes that potentially incur BC breaks. if you are motivated, its awesome if you can attempt the switch.

in a first step, that would be to remove the php-http/message-factory and require psr/http-factory, then change to use the PSR-17 RequestFactoryInterface (and maybe we need UriFactoryInterface too) instead of the current request factory.

for the discovery part, it means replacing MessageFactoryDiscovery with Psr17FactoryDiscovery (in HttpProxyClient and if there are other places, those too).

i suggest doing only that part in a first step, and only start looking into PSR-18 once we have wrapped up above and have been able to merge it.

mvhirsch commented 9 months ago

Thank you for your answer. Sounds simple and easy to me.

I'll provide a PR next week (this week are holidays in Austria) :+1:

toxicity1985 commented 8 months ago

Hello,

So the pr for the cache bundle is on waiting now ?

dbu commented 7 months ago

fixed in #566

mvhirsch commented 7 months ago

Thank you @dbu !