Closed eidng8 closed 6 years ago
No, check-platform-reqs
does not exclude require-dev
because they are clearly part of your requirements.
Seems like a non-issue either way. You should not even run composer
on your production environment.
@alcohol no, that's not right in every case.
The basic example is testing production runtime Docker image:
--no-dev
deps.composer check-platform-reqs
.However, a this point check-platform-reqs
requires from us PHP extensions of require-dev
deps to be present inside image while we do not need them there at all. We only want to check platform requirements of require
deps.
Currently we're using composer install --no-interaction --no-dev --dry-run
workaround, but it plays quite bad when config.platform
section is used in composer.json
.
So, being able to run composer check-platform-reqs
with --no-dev
flag will be a desired and useful feature.
I can see how it might be a desired feature. It is quite simple to implement, so PRs are welcome.
But I should caution that while this might make it possible to run check-platform-reqs
without require-dev
requirements, the dependency solving process will always take them into consideration. This could lead to somewhat confusing scenarios where a check-platform-reqs --no-dev
could pass as being successful, while composer install --no-dev
could fail on missing platform extensions (since it merely does not install dev requirements, but it still uses them during dependency solving).
My
composer.json
:Output of
composer diagnose
:When I run this command:
I get the following output:
And I expected
ext-xdebug
not to be checked, because it's on production environment. Then I've tried to execute:but got this:
Is there a way to exclude
require-dev
fromcheck-platform-reqs
command?