[Requirement] Move validate php version check to CodeIgniter class#4426
Conversation
MGatner
left a comment
There was a problem hiding this comment.
- This moves the check later in both entry points. Is there anything that would fail on lower PHP versions in between?
- What does a dedicated class have to offer? We already track the framework version on
CodeIgniter\CodeIgniter, seems like it might be a logical place to group this:const CI_VERSION = '4.1.1';
|
|
I guess I'm not too worries about PHP < 7, as long as executed code will work up until the check in 7+. This will become more relevant as we drop versions moving forward, so for example if someone does not read the release notes and makes a point upgrade that breaks their app at least they will know why. I would be in favor of consolidating this to |
|
All green 🎉 |
MGatner
left a comment
There was a problem hiding this comment.
The version constraint looks good, thank you for moving it! I'm not sure what has happened with the explosion of use statement changes but I would prefer to see all that in a separate PR.
|
@MGatner CLI is accessible without php version check |
| { | ||
| die( | ||
| sprintf( | ||
| 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', |
There was a problem hiding this comment.
Is it possible, if this is added to Lang?
There was a problem hiding this comment.
@totoprayogo1916 if you mean for multi language, I am not sure since it early executed.
There was a problem hiding this comment.
lang() is definitely not available yet. In general I'm okay with strictly internal messages being in English. I understand there are some internationalization efforts for PHP core but I think this is still pretty common?
abae0fd to
077ca27
Compare
…) static method to check minimum valid PHP version
077ca27 to
bd65ddf
Compare
|
rebased. |
|
Looks much better! Thanks for splitting that. What about @mostafakhudair's concern that CLI execution bypasses version check? |
|
@mostafakhudair any step to reproduce for by pass via cli ? I can't reproduce via spark command. |
|
@samsonasik @MGatner everything is working well now, I didn't know what was the problem. |
Since codeigniter4#4426, this docs shoul updated.
By centralize check, no need to change in separate files between spark and public/index.php anymore.
Checklist: