-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#1528 - Consolidate to single constant for minimum PHP version #16753
Conversation
(Standard links)
|
* Tip: Keep in sync with composer.json ("config => platform => php") | ||
*/ | ||
const MINIMUM_PHP_VERSION = '7.1.0'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For removing MINIMUM_PHP_VERSION
, we'd probably want to sequence the merges s.t. references are first removed from civicrm-{backdrop,wordpress,drupal}.git
and lastly civicrm-core.git
.
Or if you go the other way (replacing MIN_INSTALL_PHP_VER
), then I think it only needs one patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree about merging the other repos first. I think it belongs in CRM_Upgrade_Incremental_General
both because the other PHP versions are defined there and because that class is intended as a general utility class rather than a form class.
The following pull requests should be merged ahead of this one: |
I updated the other repos because they were running into test failures along the lines that |
@agh1 there is a style issue |
I agree with this I don't know which define is better but this at least migrates to just one |
8e7be2a
to
f955c30
Compare
@eileenmcnaughton i updated the missing comma--thanks |
The related PRs for I also double-checked that |
I've done some Looks good to merge. |
Overview
There have been two constants that handle the minimum PHP version:
CRM_Upgrade_Form::MINIMUM_PHP_VERSION
(for upgrades) andCRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
(for new installs). They were allowed to deviate in #14437 with the intention of making a softer transition to PHP 7. However, dev/drupal#79 illustrated a situation where sites with PHP 5.6 would be allowed to upgrade and immediately run into a fatal error.Since then, tests have been added to enforce constants in civicrm-drupal, civicrm-wordpress, civicrm-backdrop, and
composer.json
being equal toCRM_Upgrade_Form::MINIMUM_PHP_VERSION
. In discussion on dev/core#1528 @totten indicated that there's little need or desire for there to be different minimums for upgrades and new installs.In that case, there's no reason for separate constants: all they'll do is confuse everyone. This PR consolidates the two into
CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
since it sits alongside the constants for the recommended PHP version and the minimum-recommended PHP version.Before
Upgrades and tests in other repos look to one constant, while new installs and the system check look to another.
After
There is a single constant for the minimum allowable PHP version:
CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
. The minimum PHP version for upgrades may never deviate from the minimum PHP version for new installations.Comments
PRs forthcoming for civicrm-drupal, civicrm-wordpress, and civicrm-backdrop since they look to
CRM_Upgrade_Form::MINIMUM_PHP_VERSION
.