-
-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD ddev config
should infer/detect PHP version from composer.json
#4901
Comments
Unfortunately, not all projects use composer, and not all composer.json properly suggest the php version, and composer.json is not always in a predictable location. Why don't you start using |
BTW, not sure if this affects you, but most teams check in the .ddev directory, so only the team lead (or someone doing a PR) will change the configuration. |
I run lots of random PHP libraries and projects from github, where there is no .ddev directory |
So... |
I imagine this as an optional param in the |
Some frameworks (Eg. Drupal) do not have PHP declaration in their Personally, I configure DDEV once at the start of the project and commit the |
I don't expect that this would be done any time soon. AFAICT there are lots of ways for you to adapt your workflow. For example, you could add a I don't think your idea is a bad idea, but I doubt it will make priorities without support from others, but a contribution would be considered. I'm going to close this for now, but others can chime in later and of course we can reopen as needed and discuss more as needed. |
NOT completed ddev is supposed to be for PHP and it doesn't support its biggest package manager?! lemme know if you need help with this also please reopen |
I don't expect DDEV to change PHP version based on composer.json, as all projects don't even have a composer.json, and it may not be in the root. DDEV has extensive support for composer, and you can change the PHP version any time you want, Remember that for many projects the composer.json does not even exist at the time of project creation. |
I only want ddev to infer PHP version from composer.json when there is a composer.json in its root dir. ..in addition to ddev's other inferring logic, not instead :) |
I understand that you want this. Have you considered creating a PR with appropriate (and very significant) tests, or having your organization support DDEV at a substantial level? DDEV only does static PHP version inference (by project type). Otherwise it uses the default or what's configured. |
please reopen :) |
Hi @allanlaal, It's a good idea, reopened it. It reminds me how PhpStorm uses
No need to limit this to the project root. We always know the folder used for the composer inside the container, this new check should use the specified directory This feature should also respect And, of course, we need a validation for the parsed PHP version. Happy that you are interested in this! |
Somebody else was asking about a feature like this the other day. |
This is a reasonable idea, but it would completely change the traditional semantics of DDEV, so closing. People do fine with |
Is there an existing issue for this?
Is your feature request related to a problem?
I init new ddev projects daily.
going to edit the
.ddev/config.yaml
to change the actual php version from 8.0 (current global default I assume?) to whatever I actually need gets old very fastOR
user doesn't init that many ddev projects
forgets that PHP version is not inferred from
composer.json
inits a ddev project and wastes a million hours trying to figure out why everything is broken
Describe your solution
ddev config
should searchcomposer.json
in cascading order for:require-dev.php
(since we are most likely in dev, since we are using ddev)require.php
config.platform.php
Describe alternatives
manual labour
Additional context
The text was updated successfully, but these errors were encountered: