octobercms / install

Installation wizard for October CMS
122 stars 91 forks source link

Improved php version check to fix some issues #96

Closed reecube closed 6 years ago

reecube commented 6 years ago

On my computer (Windows and PHP 7.2.3 on XAMPP) the installation failed because of PHP version 7.0 or greater required.

I fixed this by changing version_compare(PHP_VERSION , "7.0", ">=") to PHP_VERSION_ID >= 70000, which is also recommended by PHPStorm IDE.

LukeTowers commented 6 years ago

@reecube please add this polyfill as well:

// PHP_VERSION_ID is available as of PHP 5.2.7, if our 
// version is lower than that, then emulate it
if (!defined('PHP_VERSION_ID')) {
    $version = explode('.', PHP_VERSION);

    define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}
reecube commented 6 years ago

Thank you for the note. I just added the polyfill.

LukeTowers commented 6 years ago

Awesome, thanks!