-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Simplify PHP version error message in index.php, install.php, api.php… #2982
Conversation
I guess until |
I was thinking like:
<?php
$minVersion = '7.3.0'; and in require_once __DIR__ . '/config.php';
if (version_compare(phpversion(), $minVersion, '<') === true) { But, it's kind of pointless to have a |
I can live w/o, but can we add styling to some css-files? 😎 |
In my opinion I would remove that message, we don’t check php extensions or any other thing, only php version.. I don’t see its utility this much as to have it in every call. |
I wouldn't bother to add any CSS to the message, literally nobody should ever see it. I also don't care if we remove it, I already do that in my local fork. But perhaps more people should put in their opinion on removing it. |
Converting to draft since I think (if we choose to keep it) that we can put it into bootstrap.php. Maybe also check for PHP modules there, which could be useful now that IIRC we require intl. |
As we were saying in another pr we could have a system check page instead of checking at every request |
Yes, but if the error is an incompatible PHP version or a missing module, it’s possible the user may not be able to reach that page. Anyway, I will be off until tomorrow morning. Will modify this PR then, and then it’s up to the community/maintainers on what direction to go. |
It could be memory setting or many other parameters. Some projects have a system check script to call on cli |
N98 magerun provides |
I suggest to move it to Mage.php (like my root check even you are unhappy), or to drop it, :). |
@@ -113,9 +113,13 @@ | |||
* | |||
*/ | |||
|
|||
if (version_compare(phpversion(), '7.3.0', '<') === true) { | |||
die('ERROR: Whoops, it looks like you have an invalid PHP version. OpenMage supports PHP 7.3.0 or newer.'); |
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.
install.php
is meant to be invoked from the cli, I think that's why there wasn't HTML before.
@luigifab is right. As long as you don't install with Since the release builder has the composer autoloader, then all new releases will check PHP version already. So I would vote to close this PR and open another to simply remove these lines from the root files. Although one small note: So we should bump the min required version, or remove |
let's remove these lines and bump to 7.4, i'm fine with those |
Description (*)
The hardcoded HTML in some root files has always bothered me. First, it contains broken html: (two closing
</a>
)But also, we really don't need those inline styles. It looks fine considering nobody should see it.
I also created the
$minVersion
variable so we don't have to change it twice in each file.Manual testing scenarios (*)
$minVersion
to9.0.0
or similar to see the error message.Questions or comments
Can we move
$minVersion
to some file that gets included so we don't have to duplicate it?Contribution checklist (*)