Welcome Guest, Not a member yet? Register   Sign In
PHP version check in index.php file

I was going through the code in latest repo, and I do have question about public/index.php file.

PHP Code:
// Valid PHP Version?
$minPHPVersion '7.1';
if (
phpversion() < $minPHPVersion)
"Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " phpversion());

It probably doesn't add more than fraction of a second to execution time, but I wonder if there's better place for this and other similar "compatibility" checks?

I could of course easily remove it myself, but because so much initial CI set up happens in index.php file, it feels sacred and could potentially change with future releases.

One of Rasmus Lerdorf talks comes in mind, where he showed frustration that frameworks do a lot of repeat work for every request even when there's no chance PHP version, or in his talk, DB engine, would change between two requests.

Maybe that check be part of vanilla non-CI core standalone script that checks specs and libraries?

Messages In This Thread
PHP version check in index.php file - by Pertti - 10-31-2018, 07:47 AM

Theme © iAndrew 2016 - Forum software by © MyBB