discovery
discovery copied to clipboard
"Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead."
php-http/message-factory has been deprecated and should be removed.
Additionally, the instructions to add
"discovery": {
"psr/http-factory-implementation": "GuzzleHttp\\Psr7\\HttpFactory"
}
Do not prevent discovery from auto-requiring message-factory if composer plugins are enabled.
i am not sure i understand? PSR-17 is the newer standard, but php-http/message-factory is not the same as PSR-17. if a consumer requires php-http/message-factory, they need it to be installed even though it has been deprecated.
if the consumer only requires psr/http-factory-implementation but not php-http/message-factory we should not be installing php-http/message-factory.
what is the situation where you see and what would you expect to happen?
Apparently this was a chain of includes that ended with symfony/http-client, which triggered discovery to force the message-factory requirement. Since there is no output for why the requirement is being triggered, it was totally unclear and I could only see it happening when discovery was enabled in composer's allow-plugins
symfony/http-client v5.4.23 Provides powerful methods to fetch HTTP resources synchronously or asynchronously
└──async-aws/core 1.18.1 (requires symfony/http-client ^4.4.16 || ^5.1.7,!=5.2.0 || ^6.0)
└──async-aws/ses 1.5.0 (requires async-aws/core ^1.9)
└──symfony/amazon-mailer v5.4.23 (requires async-aws/ses ^1.0)
composer why just said that my root package was the dependency, which wasn't true... but makes sense now.
Is it possible for Composer/Plugin.php to output a message indicating what it is that's requiring packages?
hm, the symfony http client in version 5.4 does require php-http/message-factory, but only as a develop dependency
maybe @nicolas-grekas has an idea why this is being installed and if its correct that php-http/messsage-factory is installed?
that said, if this no longer happens with symfony 6, it is probably okay. the factories have been deprecated, but we won't remove the repository, so your code will continue working.
Although the php-http/message-factory as the require-dev for symfony/http-client v5.4-6.2.x, but actually it is a required package! the nyholm/psr7removed the php-http/message-factory since v1.6, you have to install the php-http/message-factory if you want the symfony/http-client work well.
so it is a require instead of a required-dev
You need to install it in your own deps yes, because you're using an optional feature of symfony/http-client.
php-http/message-factory is required when using HttplugClient from symfony/http-client before version 6.3. Since v6.3, you can use HttplugClient without installing php-http/message-factory.