Skip to content
  • totten's avatar
    (drupal#79) Fail more gracefully when attempting to install on PHP 5.x · 1f180621
    totten authored
    Before
    ------
    
    If an admin stracts the code and navigates to `/sites/all/modules/civicrm/install/index.php`, it displays
    a syntax error.
    
    After
    -----
    
    If an admin stracts the code and navigates to `/sites/all/modules/civicrm/install/index.php`, it displays
    the message:
    
    > __PHP Version Requirement__
    > CiviCRM requires PHP 7.0+. The web server is running PHP 5.6.38.
    
    Comments
    --------
    
    This is similar to https://github.com/civicrm/civicrm-drupal/pull/583
    
    The canonical representation of the minimum PHP version is in
    `$civicrm_root/CRM/Upgrade/Form.php`.  However, setting up the classloader
    triggers a syntax error, so we need to read this without having access to
    the classloader.
    
    The approach herein has a few effects:
    
    * The minimum PHP can be read from a JSON file.
    * That JSON file is also used by `composer`, so you'll also get better errors when downloading that way.
    * At some unknown point, the minimum will probably bump up again...
    1f180621