-
Notifications
You must be signed in to change notification settings - Fork 24.5k
[5.6] Use composer platform config #4574
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
Conversation
Explain? |
If someone generates a lock file on PHP 7.2, then tries to deploy to a sever running PHP 7.1, then they're in for a mess if they have resolved depencies that require PHP 7.2. Setting the platform config like this makes sure that dependencies are resolved as if the PHP version was 7.1.3. This has particular importance when it comes to Laravel 5.5 apps, where Symfony 4 may get installed as dependencies of Symfony 3 direct dependencies. If users want to only target 7.2.0, then the can just update the mom version and the platform config accordingly. |
Doesn't composer throw a good enough error in this case? |
Wouldn't we want to set the platform to the latest stable version of PHP? Even though are minimum requirement is 7.1.3 it seems like faking the platform to that version could artificially limit us to older packages if we are running on 7.2? |
No, the best thing to do is to set it to the minimum version, otherwise the lock file is a lie, with respect to the minimum required version. If we want to set the version to 7.2.0, then I think we should also update the required php version in this composer.json too, which may not be a bad thing.
No, quite the opposite. I think this makes users think properly about their minimum required version. If they need php 7.2, or want to only support 7.2 in their app, then that's great - they can simply update the version to 7.2.0. So, if you are agreed on the idea in principle, it remains to decide weather we go for 7.1.3 or 7.2.0, and if we keep the minimum version the same as the platform version - I'd strongly recommend this. Another idea - what if the laravel installer were to set the minimum version of php and the platform version to the version of php used to generate the app, or 7.1.3, whichever is highest? Might this be confusing for users to have it do this, or good, because it matches their actual php version? |
@GrahamCampbell Will you be using this |
Yes, already have been for over a year. :) |
This is an anti-feature. People should not be responsible for checking each line of the composer.json file. |
This will stop people screwing up installations.