Closed nicolas-grekas closed 1 year ago
this could be a bit disruptive in legacy applications.
how about we just do a version 2 of php-http/message where we drop the dependency and all deprecated code we have here in message?
the solution is trivial: run the command mentioned in the exception message I don't think we need to care much about those legacy things...
Now that php-http/message-factory
has been marked as abandoned on packagist, I think this PR should be merged, since every PHP project depending on php-http/message
will now see a Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
notice when installing/updating dependencies.
PR rebased.
alright, lets do this.
This appears to break existing applications. We now get this exception in Contao when installing composer dependencies.
In MessageFactoryDiscovery.php line 29:
No message factories found. To use Guzzle, Diactoros or Slim Framework fact
ories install php-http/message and the chosen message implementation.
Note: php-http/message
is installed in this case.
[Http\Discovery\NotFoundException]
No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message
and the chosen message implementation.
Exception trace:
at vendor\php-http\discovery\src\MessageFactoryDiscovery.php:29
Http\Discovery\MessageFactoryDiscovery::find() at vendor\friendsofsymfony\http-cache\src\ProxyClient\HttpProxyClient.php:63
FOS\HttpCache\ProxyClient\HttpProxyClient->__construct() at var\cache\prod\Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php:1601
Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer->getFosHttpCache_ProxyClient_SymfonyService() at var\cache\prod\Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php:1574
Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer->getFosHttpCache_CacheManagerService() at var\cache\prod\Container4whLDxx\getFosHttpCache_EventListener_InvalidationService.php:22
Container4whLDxx\getFosHttpCache_EventListener_InvalidationService::do() at var\cache\prod\Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php:656
Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer->load() at var\cache\prod\Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer.php:1456
Container4whLDxx\Contao_ManagerBundle_HttpKernel_ContaoKernelProdContainer->Container4whLDxx\{closure}() at
vendor\symfony\event-dispatcher\EventDispatcher.php:267
Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() at vendor\symfony\event-dispatcher\EventDispatcher.php:230
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() at vendor\symfony\event-dispatcher\EventDispatcher.php:59
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at vendor\symfony\console\Application.php:1073
Symfony\Component\Console\Application->doRunCommand() at vendor\symfony\framework-bundle\Console\Application.php:96
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at vendor\symfony\console\Application.php:301
Symfony\Component\Console\Application->doRun() at vendor\symfony\framework-bundle\Console\Application.php:82
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at vendor\symfony\console\Application.php:171
Symfony\Component\Console\Application->run() at vendor\contao\manager-bundle\bin\contao-console:38
include() at vendor\bin\contao-console:120
composer show php-http/message
name : php-http/message
descrip. : HTTP Message related tools
keywords : http, message, psr-7
versions : * 1.16.0
the exception message in discovery seems wrong, it should explicitly talk about php-http/message-factory and not just php-http/message.
the quickfix for contao would be to require php-http/message-factory explicitly. the better fix would be to switch to the PSR-17 message factories instead of the httplug message factories. but depending on where those factories are used in contao, this could be a BC break for contao.
the quickfix for contao would be to require php-http/message-factory explicitly.
@dbu But php-http/message-factory
is abandonded and when using the suggested replacement (psr/http-factory
) the error still occurs.
but depending on where those factories are used in contao, this could be a BC break for contao.
They are not used by us at all. This error happens through a transient dependency (friendsofsymfony/http-cache
).
@fritzmg damn, then its me again :/ will fix that in https://github.com/FriendsOfSymfony/FOSHttpCache/pull/543
i (or some contributor) should upgrade FOSHttpCache to use the PSR-17 mesage factories as it still relies on the legacy php-http message factories.
should be fixed now https://github.com/FriendsOfSymfony/FOSHttpCache/releases/tag/2.15.1
Works, thank you :)
php-http/message-factory
contains only deprecated interfaces. It'd be great to not force users of this lib to install it. Note that all concerned classes are already deprecated since years.