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
Allow PHP 8.2 #13759
Allow PHP 8.2 #13759
Conversation
975a2bb
to
5ac8da2
Compare
index.php
Outdated
@@ -36,10 +36,10 @@ | |||
// Check PHP version not to have trouble | |||
// Need to be the very fist step before any include | |||
if ( | |||
version_compare(PHP_VERSION, '7.4.0', '<') || | |||
version_compare(PHP_VERSION, '8.2.0', '>=') | |||
version_compare(PHP_VERSION, '7.4.0-dev', '<') || |
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.
why those -dev
?
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.
we should have same versions ins both files
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.
-dev
suffixes are added during comparison in requirement check, see
glpi/src/System/Requirement/PhpVersion.php
Lines 79 to 84 in 0046d6d
$this->validated = version_compare(PHP_VERSION, sprintf('%s-dev', $min_version), '>=') | |
&& version_compare(PHP_VERSION, sprintf('%s-dev', $max_version), '<'); | |
$this->validation_messages[] = $this->validated | |
? sprintf(__('PHP version (%s) is supported.'), PHP_VERSION) | |
: sprintf(__('PHP version must be between %s and %s (exclusive).'), $min_version, $max_version); |
So I added -dev
suffix here to do the exact same comparison.
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.
we should have same versions ins both files
That does not explain this difference
Allowed PHP version has been updated in
inc/define.php
but not inindex.php
.glpi/inc/define.php
Lines 51 to 52 in 0046d6d
We did not detect it earlier as we are probably all using a pre-release version (that is considered as less than
8.2.0
). Using-dev
suffixes in comparison will prevent PHP 8.3 pre-releases to be accepted. Test will be similar to the test done in requirements checking:glpi/src/System/Requirement/PhpVersion.php
Lines 79 to 84 in 0046d6d
Note that checks has been refactore in main to simplify versions declaration: #13260