roots / wordpress

Automatically updated WordPress Composer package
https://roots.io/composer-wordpress-resources/
MIT License
171 stars 15 forks source link

Determine minimum PHP version for WordPress core #9

Closed tangrufus closed 2 years ago

tangrufus commented 5 years ago

This implementation breaks for non-stable versions, i.e: beta and rc. https://github.com/ItinerisLtd/wordpress/blob/1d34138b86fb5500480c97fba159b30afbe2a87d/src/MinPhpVersion.php would be a more robust alternative. However, it requires introducing composer to the build system.

See:

austinpray commented 5 years ago

Sweet, can test when I get home later.

@roots/everyone so I can merge this and it will only affect future releases. However, this runs the risk of pulling the rug out from some people. Consider:

Do we just recommend people fake it with composer.platform.php?

https://getcomposer.org/doc/06-config.md#platform

Is there some way we can get composer to show this recommendation?

tangrufus commented 5 years ago

Question: Does this make old relreases immutable?

https://github.com/roots/wordpress/blob/049d863d1e43b059884ec9a2f09263f38783a180/bin/update-repo.php#L187


I can merge this and it will only affect future releases. However, this runs the risk of pulling the rug out from some people.

However, this is not ideal. The new 5.2 and 5.2.1 might never be downloaded because of composer caches.

Or, make this change and hope nobody installs 5.2 and 5.2.1 with incorrect PHP

- version_compare($version, '5.2', '<')
+ version_compare($version, '5.2.2', '<')
austinpray commented 5 years ago

Question: Does this make old relreases immutable?

Yep the updater script is idempotent cause of this line. We def want to avoid undefined behavior with cache status/hash collisions.

tangrufus commented 5 years ago

make a composer plugin that echo warning messages

This is a prototype: https://github.com/ItinerisLtd/roots-wordpress-announcement


After a second thought, composer generate checksum of the zip file. As the zip file doesn't include composer.json. We might be lucky this time.

However, we need to test what happen if we change 5.2 and 5.2.1 tags on packagist.org.


Alternatively, we could require the composer plugin in roots/wordpress-core-installer. Thus, keeping 5.2 and 5.2.1 unchanged.

swalkinshaw commented 2 years ago

https://github.com/roots/wordpress-packager is taking care of this now and will be reflected in the new packages.