Problem/Motivation
This is a follow-up to #2843328: Enforce minimum PHP version in composer dependencies
In that issue, we learned that it's hard to unit-test against the minimum PHP requirement for Drupal.
That's because the DRUPAL_MINIMUM_PHP
constant lives in core/includes/bootstrap.inc
, which is not autoloadable in unit tests.
This is also true of DRUPAL_MINIMUM_PHP_MEMORY_LIMIT
.
This kind of awkward constant definition leads to the solution in #2843328: Enforce minimum PHP version in composer dependencies which is to define a similar constant on the test class, and also to re-definitions of constants as in ThemeHandlerTest.
Also this true of DRUPAL_MINIMUM_SUPPORTED_PHP
and DRUPAL_RECOMMENDED_PHP
that introduced in #3039287: Implement changes required to remove support for PHP 5.5 and 5.6
Proposed resolution
Deprecate these constants in bootstrap.inc
.
Move the constants to an appropriate autoloadable class. This could be in the installer system or \Drupal
, or a constants-only class designed for this purpose.
Update: The chosen solution is to add 4 constants to the class \Drupal
.
Remaining tasks
Follow-up to remove usages of deprecated constants.
User interface changes
None
API changes
Deprecates DRUPAL_MINIMUM_PHP
, DRUPAL_MINIMUM_SUPPORTED_PHP
, DRUPAL_RECOMMENDED_PHP
and DRUPAL_MINIMUM_PHP_MEMORY_LIMIT
Adds to the class Drupal
the following 4 constants: \Drupal::MINIMUM_PHP
, \Drupal::MINIMUM_SUPPORTED_PHP
, \Drupal::RECOMMENDED_PHP
and \Drupal::PHP_MEMORY_LIMIT
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#172 | 2908079-172.patch | 20.64 KB | jungle |
#172 | interdiff-170-172.txt | 790 bytes | jungle |
Comments
Comment #2
xjmThemeHandlerTest is already wrong, unfortunately:
So yeah, we need a solution for this.
Should we just add it to
\Drupal
whereVERSION
lives for now?Comment #3
Mile23The actual value of
DRUPAL_MINIMUM_PHP
doesn't really matter that much forThemeHandlerTest
, because the constant is only defined so the dependencies can be resolved without adding an include. Nevertheless we'd like to test against the actual constant, wouldn't we? :-)Figuring out where to put these constants is awkward. I don't like \Drupal in general, and it's supposed to be about discovering services and not having constants for stuff. So really
\Drupal::VERSION
is misplaced. (There should be aDrupal\Core\Release
class or something.)I added a class called
Drupal\Core\Php
with the various constants, plus deprecation notices. When we decide this part we can add a follow-up to remove deprecated usages.Comment #4
xjmCould we call it
Requirements
or something? NotPhp
. :PComment #5
Mile23One of the two hardest things in computer science. :-)
Comment #6
mpdonadioI like this, and I like not having this in the `\Drupal` class. I also like the name Requirements, as it may provide a nice home for future needs.
Since this is already in the `Drupal\Core`, do we need the 'DRUPAL_' prefix on these constants? Or do we want to keep this as they are one-to-one mappings? I think the former would be better.
We are deprecating something, so we need a CR. I stubbed out https://www.drupal.org/node/2909361 so we have something to reference and will write it up later.
NW, for needing to write the CR and needing to reference the CR in the deprecations.
Comment #7
mpdonadioFirst pass at CR. Added @see CR to the docblocks.
Comment #8
xjmSince we now have a namespaced class, I think we can remove
DRUPAL_
from the beginning.I'm not sure this one belongs here; actually I'm not sure it belongs anywhere. It's only used in two places: by
update.module
, to look for.info.yml
files, andinstall.inc
, to detect... a database driver, of all things.So I'd suggest removing this one from the patch and filing a separate issue to deprecate and get rid of it entirely. It has two usages that are not even really conceptually related. Seems like a legacy thing.
Thanks @Mile23 and @mpdonadio!
Comment #9
Mile23Comment #10
mpdonadio#8 done, updating CR shortly.
Comment #11
xjmThis looks good to me. One question occurred to me:
I wondered, is there any risk of these constants being needed at a point when the autoloader isn't available? That prompted me to look at things in the early installer before the autoloader is initialized, and there's a spot in
install.php
that hardcodes the version to avoid fatal errors. So we're okay on that front (at least in terms of the very early installer). We can discuss what to do about that separately I think.The constant isn't used anywhere else that seemed like a risk.
Comment #12
xjmComment #13
mpdonadioMade #2910070: Figure out better solution for PHP version check in install.php.
Comment #14
andypostMost of time constants are defined in interfaces.. is there a reason to make in in class?
This removal looks unrelated
Comment #15
RoSk0Re-roll.
Comment #17
RoSk0Missed Requirements class.
In respect to #14:
1) For me it feels strange to have that constants in the interface that not meant to be implemented.
2) Yes and no. Such a clean up is always a good thing for me, so I will leave a decision to someone else.
Comment #18
dawehnerI am a bit confused why one can remove those here as well, but we don't deprecate them
Comment #19
martin107 CreditAttribution: martin107 as a volunteer commentedThe development branch is now 8.6.x
so we need to upgrade our comments of the form.
@deprecated in Drupal 8.5.0
Comment #20
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedHi All,
I was checking the issue reported and moving all the expected const to Requirements:: to prevent duplicate const declarations. Hope it works!
Comment #21
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedComment #23
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedPatch udated to prevent remove variables and adding @deprecated
Comment #24
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedFix patch name
Comment #25
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedComment #26
mpdonadioCan we get an interdiff? Not sure why this patch jumped from 3k to 10k.
Comment #29
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedUpdated patch to allow install.php file access to the Requirements class + interdiff
Comment #30
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedComment #31
gumanist CreditAttribution: gumanist for Skilld commented1. Typo, as renamed without DRUPAL_
2.
+// The minimum version is specified in the Drupal\Core\Requirements interface
we have class, not an interface
3. PHP_VERSION vs phpversion()
probably it is out of the scope of the issue, but is there any sense of using different ways of getting actual PHP version?
4. Not sure, but wouldn't it be better to add PHP version validation function to the Requirements class to be more DRY?
5. As we introduced Requirements.php, don't be better to move code from core/lib/Drupal/Component/Utility/Environment.php to it and deprecate Environment.php or extend Environment.php with version validation?
6. Probably it is out of the scope as well, but it looks like constants REQUIREMENT_ERROR, etc should be moved to Requirements class
Comment #32
mpdonadioRe #31-3-6, I think we can explore those ideas in the future but the scope of this issue is really just to move those constants onto a class (or interface, but IMHO an interface w/o a class is a bad idea) to solve the problem of needing them when unit testing, which will help some of the composer related issues and will pop up once we drop 5.5 and 5.6.
As a side note, PHP_VERSION vs phpversion(), the function is better as it can be mocked or shadowed for testing purposes.
Comment #33
piggito CreditAttribution: piggito as a volunteer and at Skilld commentedFixing comments 1 and 2 in #31
Comment #34
anavarreNeeds reroll after https://www.drupal.org/node/2709919
Comment #35
dawehnerComment #36
volegerComment #37
dawehnerIs there a reason to revert some of these changes ... ?
Comment #38
andypostComment #39
dawehnerNeeds work based upon #37
Comment #40
andypostGoogle reports consts in interfaces is a bad practice for php & java
So I think this class should be final at least
Comment #41
andypostComment #42
volegerCleanup
Comment #43
borisson_#42 looks solid.
Comment #45
mpdonadioReroll. Fixing one little thing shortly.
Comment #46
mpdonadioThis moves the recommended version to the new class, and also removes a hardcoded value in a test.
Did a search for the issue number, and I think we caught all of the @todos, and did some usage reports in PhpStorm, and think we have caught all of the uses in core.
Comment #47
andypostboth places use files from current "core" dir
Comment #48
dawehnerIsn't this a problem because this now probably at least requires php 5.4 to even start executing this code?
Comment #49
mpdonadio#48, https://3v4l.org/5mS1U
Or were you thinking about `__DIR__`? That was introduced in 5.3.0, per http://php.net/manual/en/language.constants.predefined.php
Comment #50
andypostYes
__DIR__
will fail earlyThe first one looks better to revert cos it will fail in PHP < 5.3 but in second one we are safe
Comment #51
dawehner@mpdonadio Nice research. Thank you!
Comment #52
alexpottIf we're making this configurable we should change the message to use the constant too.
can this be removed? If we've replaced all the usages then the test doesn't need to fake it.
Comment #53
mpdonadioShould take care of #52.
Comment #56
volegerNeeds reroll
Comment #57
RoSk0Reroll
Comment #58
RoSk0Comment #60
volegerNeeds review of the patch as all of the tests passed.
Comment #61
claudiu.cristeaNice. Only nits:
8.6.0 => 8.7.0. The CR "Introduced in branch" field should be adapted too.
According to Drupal API documentation standards (general):
So, the beginning 2nd line ("The minimum..") should start on the 1st line.
Comment #62
claudiu.cristeaAlso... in other issue I'm trying to deprecate
drupal_set_time_limit()
and I'm looking for a place for a new static method that is suppose to replace the procedural function. Could we rename the new classDrupal\Core\Requirements
asDrupal\Core\Php
, so that we can add there such methods, that are actually setting the PHP environment?Comment #63
andypostI think better to create separate helper class like
\Drupal\Component\Utility\Php
for wrappers like other utility methods hereComment #64
claudiu.cristea@andypost, usually, components are something that are self contained and make sens outside Drupal. Here's the other issue #3000057: Deprecate drupal_set_time_limit() and file_upload_max_size() and move to Environment component.
Comment #65
Mile23@claudiu.cristea: Re: #62, see #4. :-)
Comment #66
claudiu.cristea@Mile23, missed that :)
But now, anticipating #3000057: Deprecate drupal_set_time_limit() and file_upload_max_size() and move to Environment component, I think we can reconsider #4?
Comment #67
andypostBut class
Requirements
still needed for constants #2909480-5: Move REQUIREMENT_* constants out of install.inc fileComment #68
volegerrerolled
addressed #61
Comment #70
claudiu.cristeaReolled, removed other occurrence from a new tests. Interdiff is against #61.
Comment #71
claudiu.cristeaForgot the patch :)
Comment #73
claudiu.cristeaOops! Forgot to rebase on top of 8.7.x so it needed a new reroll.
Comment #75
Krzysztof Domański1. I have removed unnecessary or unrelated changes to this issue (interdiff).
2. I changed recommended PHP version (7.1 -> 7.2) after #3034202: Recommended php version is 7.2 was fixed (re-roll).
3. All occurrences of deprecated constants (DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, DRUPAL_RECOMMENDED_PHP, DRUPAL_MINIMUM_PHP) have been changed/removed.
+1 RTBC
Comment #76
volegerLooks good
Comment #77
larowlanwhy do we need the require_once here? is this for 'stuff is so bad the autoloader is broken'?
Comment #78
volegerLooks like that. Autoloader included in a few lines below.
Comment #79
volegerRerolled.
Added deprecation for DRUPAL_MINIMUM_SUPPORTED_PHP constant.
Fixed deprecation message for DRUPAL_RECOMMENDED_PHP constant.
Moved minimal version check to autoload file.
Comment #81
naveenvalechaUpdate the deprecated message.
Also, updated the CR to 8.8.0
Also, changed the usage of the DRUPAL_MINIMUM_SUPPORTED_PHP
Comment #82
volegerReroll. No interdiff "Error applying patch1 to reconstructed file"
Current minimum php version is bumped to the
7.0.8
.Updated Requirements.php minimal version constant value and deprecation messages in bootstrap.inc to meet CS requirements.
Comment #83
Mile23Here's a fix for
ThemeHandlerTest
andThemeExtensionListTest
in a narrower scope: #3054674: ThemeHandlerTest and friends break isolation for constantsComment #84
Krzysztof DomańskiComment #85
volegerConflicts are just in the "use"'s sections that ware changed recently. So just reroll and fix the CS issues with deprecation messages.
There were no new usages of the constants since May...
Comment #86
volegerComment #87
Krzysztof Domański1. There are two constants with the same description "Minimum supported version of PHP." IMO
MINIMUM_PHP
also needs an additional description.2. Maybe there should be one constant
MINIMUM_SUPPORTED_PHP
? Is there any difference?Comment #88
voleger+++ b/core/lib/autoloader.php
@@ -0,0 +1,14 @@
+// Checking minimum PHP version to avoid fatal errors.
+if (version_compare(PHP_VERSION, Requirements::MINIMUM_PHP) < 0) {
+ print 'Your PHP installation is too old. Drupal requires at least PHP ' . Requirements::MINIMUM_PHP . '. See the system requirements page for more information.';
+ exit;
+}
+++ b/core/modules/system/system.install
@@ -186,11 +187,11 @@ function system_requirements($phase) {
// Check if the PHP version is below what Drupal supports.
- if (version_compare($phpversion, DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) {
+ if (version_compare($phpversion, Requirements::MINIMUM_SUPPORTED_PHP) < 0) {
$requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version. It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See PHP\'s version support documentation and the Drupal 8 PHP requirements handbook page for more information.',
Here the difference:
MINIMUM_PHP checked before Drupal bootstrap and do not allow use the Drupal core with not compatible version of PHP
MINIMUM_SUPPORTED_PHP warn the administrator of the usage of outdated and not recommended version of the PHP
Comment #89
volegerI think that documentation update we can do at the followup issue at any time, but remove deprecated constant only from the next major release.
Let's move forward and try to replace as much as possible API that left in the legacy includes files.
Comment #90
Krzysztof Domański1. Needs re-roll.
2. I agree with #89. It's near RTBC! Needs followup due to #87 and #88.
Comment #91
volegerJust reroll
Comment #92
Krzysztof DomańskiNeeds change record and issue summary update. Global PHP-related constants for minimum values are deprecated is outdated.
Comment #93
volegerAdded mentions that we also deprecate
DRUPAL_MINIMUM_SUPPORTED_PHP
constant. Added related issue where this constant was introduced.Comment #94
Krzysztof DomańskiAdressed #89. Now we can add @todo with the link to #3085402: Improve the documentation of Requirements::MINIMUM_SUPPORTED_PHP and Requirements::MINIMUM_PHP.
Comment #95
volegerNoticed that docblock for
Requirements::MINIMUM_PHP
was outdated in comparison withDRUPAL_MINIMUM_PHP
.So I synchronized the documentation and also keep the same behavior for the request to
install.php
.Comment #96
Krzysztof Domańskihttps://www.drupal.org/pift-ci-job/1423791
Unrelated test failure at PHP 7.
#3085512: Remove Class Constant Visibility from HelpTopicTwigTest which breaks tests at PHP 7
https://www.drupal.org/pift-ci-job/1423789
This looks like a random test failure.
Comment #97
volegerComment #98
Krzysztof DomańskiLooks good to me. Test failure at PHP 7 is unrelated. See #96.
Comment #99
Krzysztof DomańskiNeeds re-roll. #3052703: Deprecate drupal_installation_attempted() was commited.
Comment #100
andypostfast reroll
Comment #101
Krzysztof DomańskiComment #102
alexpottI think we should reconsider the location and name. The name because it has nothing to do autoloading. I think there is a good case for a file to exist like this. It'd be useful for doing other things like setting up class aliases. The location is also a bit odd because it's going against the README.txt in the same directory. This file is not "autoloadable" per se.
Also if we do this we need to run
$ composer update drupal/core
in order to add the changes to composer.lockBut see next comment. Imo this change should be delegate to a follow-up.
I think this should be a follow-up and done in this issue. This isn't using a deprecated constant - yes it'd be great if it was but it's out-of-scope for deprecating the constants in boostrap.inc.
Great use of final!
Comment #103
voleger#102.1 and #102.2: Oh, right, we have already an issue regarding the install.php file. So let's introduce that solution in #2910070: Figure out better solution for PHP version check in install.php.
So I'll revert those changes in the current patch as we have no deprecation replacements there. And I will introduce the patch with those changes in #2910070: Figure out better solution for PHP version check in install.php and postpone it on this issue.
Comment #104
Krzysztof Domański1. #102 was addresed.
2. Needs change record update Global PHP-related constants for minimum values are deprecated.
Comment #105
alexpottI've been doing some thinking about this change. Whilst giving this a final review I started wondering why these constants weren't going on
\Drupal
. In #3 @mile23 wroteI'm not sure that I agree with this. Firstly, \Drupal feels more like an application class that should have these application wide constants on. Secondly, it’s the service location parts of that class that are problematic not the constants.
The solution the current patch comes up with is to add a
\Drupal\Core\Requirements
class. I think that adding things to core/lib/Drupal/Core needs careful thought or that’s going to become a dumping ground and I'm not sure this belongs there.I feel that there are 2 solutions:
The first has problem that it doesn't solve things like #2909480: Move REQUIREMENT_* constants out of install.inc file (which is also creating a requirements class). The more I think about it the more I like the second because:
The one downside is this approach is only available to core and not core modules/themes, or contrib or custom because they don't using composer to set up their autoloading. But I'm not sure that outweighs the advantages listed.
I have a patch to move these to \Drupal (attached) but I'm interested in other opinions on the core/constants.php idea.
Comment #106
volegerFrom DX perspective I don't like the idea just to move constants into
core/constants.php
file as-is. Wrapping constants into a class made them more discoverable during coding in the IDE. So comparing the namespace naming\Drupal::MINIMUM_PHP
vs\Drupal\Core\Requirements::MINIMUM_PHP
,\Drupal
looks more short.So my proposals are to move constants to the namespaced class, but which one of the namespaces to choose - also interested in other opinions.
Comment #107
alexpottIDEs discover global constants just fine in my experience.
Comment #108
alexpottScreenshot evidence for #107
Comment #109
volegerYes, exactly. That suggests all constant prefixed for different purposes.
Classes create the scope of the constants which can be defined for the specific purpose.
But if we want just to get rid of the include files, it's fine to just move the constant to autoloadable file as is, and then deprecate with removal in Drupal 10.
Comment #110
mpdonadioRe #105, what about putting the new constants on core/lib/DrupalInterface or similar? I recall an issue about preferring interfaces for constants because of some weirdness that can happen during autoloading? There are some early comments that allude to this, but memory foggy here.
Comment #112
daffie CreditAttribution: daffie commentedComment #113
daffie CreditAttribution: daffie commentedComment #114
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedComment #115
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedDone re-roll for 9.1.x. Please review.
Comment #116
volegerVersions in the deprecation messages needs to be updated.
Comment #117
jungleRe #115 and #116, the patch is for 9.1.x, should not deprecation messages suppose to be removed in 9.x?
Comment #118
andypost@jungle current dev is 9.1, it's where we can deprecate for 10.0
Comment #119
jungleThanks, @andypost! Versions updated.
Comment #120
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedComment #121
daffie CreditAttribution: daffie commentedComment #122
jungleAddressing #121.1 and updated min version to 7.3.0/7.3 according to the official documentation here
Comment #123
jungleCR updated
Comment #124
daffie CreditAttribution: daffie commentedComment #125
daffie CreditAttribution: daffie commentedComment #126
jungleUpdated API changes section of IS again according to the patch in #122
The namespace/class is \Drupal or Drupal, not Requirements
Comment #127
daffie CreditAttribution: daffie commented@jungle: Thanks I missed that.
Comment #128
jungleSelf-review, needs updating the inline comment further.
Comment #129
jungleAddressing #128
Comment #130
jungleUsing the new constant.
Comment #131
jungleSorry for so many noises ...
Comment #132
jungleUsed the URL of Environment requirements of Drupal 9 page's canonical URL, -- node/nid, instead of the alias. In case updating of the alias in the future.
Comment #134
jungleMove up the autoloader and init it right before using the new constant.
Comment #135
volegerThis is out of scope, see a follow-up: #2910070: Figure out better solution for PHP version check in install.php
Comment #136
jungle@voleger, thanks for pointing it out. But I do not think it's out of the scope as no remarkable progress on #2910070, and no consent has been reached yet, Meanwhile, the change here does not conflict with finding a better solution for PHP version check -- the scope of #2910070.
I'd set this back to Needs review to get feedback from others, or if you persist on NW, I'm ok to reroll a new patch without touching that part.
Comment #137
daffie CreditAttribution: daffie commentedPatch looks good. Some remarks:
Can we use the link "https://www.drupal.org/docs/9/how-drupal-9-is-made-and-what-is-included/..." instead of "https://www.drupal.org/node/3053125".
Can we change the link to the Drupal 9 version.
Why is the variable $links removed from the if-statement. It is not within the scope of this issue.
Comment #138
jungleThanks, @daffie for reviewing. Addressing #137
Comment #139
junglelet the links be consistent, both having the anchor.
Comment #140
daffie CreditAttribution: daffie commentedFor #135: I have looked at #2910070: Figure out better solution for PHP version check in install.php and my opinion is that the patch from this issue is in scope.
All the code changes look good to me.
The patch is for me RTBC.
Comment #141
xjmComment #142
xjmCouple questions.
So, back in the day, the reason we exited early here (before the autoloader was available) was that namespaces weren't supported until PHP 5.3, so on PHP 5.2 and earlier, the installer would whitescreen with a fatal error / no explanation.
We would get into that situation again here if the autoloader contained any PHP syntax that wasn't compatible with the user's installed version of PHP.
How will we ensure that the autoloader continues to work on old PHP versions, even if the rest of Drupal doesn't?
How are we going to ensure that this hunk doesn't get out of sync again next time?
Comment #143
xjmComment #144
xjmAn alternative approach to moving the autoloader would be to put documentation both on the
\Drupal
constant and on the exit line in the installer reminding the developer to keep the two in sync.I don't mean to say moving the autoloader is a no-go -- it might be alright. We should just make sure we're comfortable with the impact it could have if the autoloader's PHP version compatibility changes in the future.
Comment #145
jungleRe #142.1 Do not understand, index.php requires the autoload.php at the very first line, if the autoaloader in install.php can go wrong, we should ensure it works in index.php too, but index.php does not do anything for that purpose.
Re #142.2, removed them completely, as it's inside a test file, if the class constant does not present, the test itself should not be detected too, because we are using autoloader. It's redundant to me. Removed them from the following two files:
Comment #146
jungleKeep the variable naming of autoloader in install.php be consistent with which in index.php, rebuild.php, update.php and authorize.php
Comment #147
daffie CreditAttribution: daffie commentedIf I understand @xjm correctly, what she wants is that when somebody who wants to install Drupal with an older version of PHP gets a nice error message instead of a WSOD. When that user is using a PHP version that is lower then 5.3, the that person will get a WSOD when you try to do
$class_loader = require_once $root_path . '/autoload.php';
. The code change @xjm is looking for is something like:All the other changes look good to me.
Comment #148
jungle@daffie. thanks for your review and explanation!
Addressing #147
Comment #149
daffie CreditAttribution: daffie commentedThe change by replacing "7.3.0" to "\Drupal::MINIMUM_PHP" is wrong, because we have not done the autoload part.
You only removing this code. It is the explanation of why we are doing the next couple of lines the way we do it. We need that explanation to be there and it needs to be updated for the change that this issue brings. See my suggestion in comment #147.
Comment #150
jungleThanks again @daffie!
Sorry, missed #149.1.
#149.2, I am adding it back.
Comment #151
junglePlease ignore the files uploaded in #150. The comment of this patch in #151, is copied from #147, in case you think it's still better than the improved version in #152 coming next.
Comment #152
jungleThe comment in this patch combined the original comment with @xjm's comment in #142
Comment #153
jungleComment #154
daffie CreditAttribution: daffie commentedAll the code changes look good to me.
All @xjm's points are addressed.
Back to RTBC.
Tiny nitpick: The dot after "7.3.0" is missing. We are ending a sentence. Can be fixed on commit.
@jungle: Thank you for all your work on this issue!
Comment #155
jungleEagle eyes! @daffie, Thank you!
Adding the missing dot/full stop. meanwhile, adjusted the indentations of the comment.
Comment #156
jungleForgot to upload the patch 🤦
Comment #157
xjmThanks @daffie for helping explain what I was asking for. :)
This is looking really close. Only two more pieces of feedback:
We need to add docs in both these places reminding the developer to update the installer requirement here whenever
\Drupal::MINIMUM_PHP
is updated and vice versa.This change is out of scope.
Comment #158
jungleThanks, @xjm.
Addressing #157
Comment #159
daffie CreditAttribution: daffie commentedAll points of @xjm are addressed.
All code changes look good.
Back to RTBC.
Comment #160
xjmThanks, this is almost there. Just a couple grammar fixes:
I don't think we need to have a second paragraph here; let's continue the paragraph after explanation. "Two" should also be spelled out as a word according to our content standards.
The grammar also needs a little work. "Remember updating..." would mean the reader had already done it in the past, like "Remember traveling before this pandemic?" "Remember to update" will instruct the reader to do it in the future. :)
So, all together, I suggest rewriting it like this for clarity:
Couple small grammar corrections here as well. It should say:
That said, though, I'd suggest rewriting it a little more for clarity, like this:
Thanks @jungle and @daffie!
Comment #161
jungleXiexie @xjm!
How I wish that I were a native English speaker :p
Comment #162
jungleComment #163
daffie CreditAttribution: daffie commentedThe changes look good to me.
All points of @xjm are addressed.
Back to RTBC.
Sorry @xjm: Both @jungle and me are not native English speakers.
Comment #164
xjm:D All good; you both speak English better than I speak any second language. :)
The docblock for the installer still wasn't quite clear enough when I read the whole thing together, so I took a stab at rewriting it myself (attached).
I also clarified the one-line summary for
\Drupal::MINIMUM_PHP
because the difference between it and\Drupal::MINIMUM_SUPPORTED_PHP
was still confusing even with all this added information. It's maybe on the edge of the scope, but if we did it in a followup the docblocks for the new API and the deprecated one would end up out of sync., and it affects how someone might understand the bit in the installer.Comment #165
daffie CreditAttribution: daffie commentedLook fine to me.
Back to RTBC.
Comment #166
jungleBased on the fact that
DRUPAL_MINIMUM_PHP
andDRUPAL_MINIMUM_SUPPORTED_PHP
(\Drupal::MINIMUM_PHP
and\Drupal::MINIMUM_SUPPORTED_PHP
) are identical in the 8.8.x and 9.1.x.Thanks!
Comment #167
xjmThanks @jungle. The constants are the same at the moment, but they weren't in 8.7. This was our way of solving a problem we had for dropping support for PHP 5:
DRUPAL_MINIMUM_PHP
preventsupdate.php
from being run.So, we came up with a plan to phase out PHP 5 support gradually: First, with a warning on the status report (starting in 8.4), second, with a warning in the installer (starting in 8.5), third, with a warning on
update.php
and an error on the status report and the installer (starting in 8.7), and third, with a hard error onupdate.php
(starting in 8.8). So, we introducedDRUPAL_RECOMMENDED_PHP
andDRUPAL_MINIMUM_SUPPORTED_PHP
for the first three phases of that.We also needed to allow Drupal's test suite to continue running without errors on PHP 5.5 and 5.6 during the transition, so we introduced conditional logic in the install and update tests that checked the values of those constants and clicked past the warnings when they were expected on test environments with that PHP version.
We don't need the constants for now, but we might need them again in the future when we want to phase out support for an older PHP version.
This reminds me also that we should increase the value of
DRUPAL_RECOMMENDED_PHP
to 7.4 for 8.9, since it's going to be supported until 2021.Comment #168
xjmI posted #3135250: [8.9 only] Increase recommended PHP version to 7.3 prior to release which will require a simple reroll here (or vice versa).
Comment #169
jungle@xjm, many thanks for your detailed explanation, putting a
needs reroll
against 8.9.x as #3135250: [8.9 only] Increase recommended PHP version to 7.3 prior to release landed.Comment #170
jungleRerolled a patch from #164 against 9.1.x. Removing the "Needs reroll" tag, to do it after the 9.1.x patch gets committed.
Comment #171
alexpottWe should still be using
$this->assertStringContainsString()
- this is reverting another change.Comment #172
jungleThanks, @alexpott, addressing #171
Comment #173
daffie CreditAttribution: daffie commentedAddressed the point from @alexpott.
No other occurrences of that kind.
Back to RTBC.
Comment #174
jungleNeeds re-roll if #3151118: Include bootstrap.inc using composer lands first. Or this is won't fix?
Comment #175
alexpottWell if #3151118: Include bootstrap.inc using composer lands we could debate whether do this deprecation is actually worth it. I'm not sure it is.
Comment #177
xjmCommitted and pushed to 9.1.x, thanks! (My only contribution to the patch directly was some English grammar rewriting stuff, so still seems fine for me to commit it.)
Comment #178
xjmAlso published the CR.