diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc --- b/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -28,11 +28,10 @@ * - If a site managed to bypass all of the above, then an error is shown in * the status report and various fatal errors occur on various pages. * - * @see install.php - * * @deprecated in Drupal 8.7.x, will be removed before Drupal 9.0.0. Use * \Drupal\Core\Requirements::MINIMUM_PHP instead. * + * @see install.php * @see https://www.drupal.org/node/2909361 */ const DRUPAL_MINIMUM_PHP = Requirements::MINIMUM_PHP; @@ -46,10 +45,12 @@ * that Drupal no longer supports that PHP version. * - An error is shown in the status report that the PHP version is too old. * - * @todo Move this to an appropriate autoloadable class. See - * https://www.drupal.org/project/drupal/issues/2908079 + * @deprecated in Drupal 8.8.x, will be removed before Drupal 9.0.0. Use + * \Drupal\Core\Requirements::MINIMUM_SUPPORTED_PHP instead. + * + * @see https://www.drupal.org/node/2909361 */ -const DRUPAL_MINIMUM_SUPPORTED_PHP = '7.0.8'; +const DRUPAL_MINIMUM_SUPPORTED_PHP = Requirements::MINIMUM_SUPPORTED_PHP; /** * Minimum recommended version of PHP. @@ -59,7 +60,7 @@ * that have reached their EOL or will in the near future. * * @deprecated in Drupal 8.7.x, will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Requirements::MINIMUM_PHP instead. + * \Drupal\Core\Requirements::RECOMMENDED_PHP instead. * * @see https://www.drupal.org/node/2909361 */ diff -u b/core/install.php b/core/install.php --- b/core/install.php +++ b/core/install.php @@ -6,7 +6,6 @@ */ use Drupal\Component\Utility\OpCodeCache; -use Drupal\Core\Requirements; // Change the directory to the Drupal root. chdir('..'); @@ -22,14 +21,6 @@ */ define('MAINTENANCE_MODE', 'install'); -// Checking minimum PHP version to avoid fatal errors. The minimum version is -// specified in the Drupal\Core\Requirements class. -require_once __DIR__ . '/lib/Drupal/Core/Requirements.php'; -if (version_compare(PHP_VERSION, Requirements::MINIMUM_PHP) < 0) { - print 'Your PHP installation is too old. Drupal requires at least PHP ' . Requirements::MINIMUM_PHP . '. See the system requirements page for more information.'; - exit; -} - // Initialize the autoloader. $class_loader = require_once $root_path . '/autoload.php'; diff -u b/core/lib/Drupal/Core/Requirements.php b/core/lib/Drupal/Core/Requirements.php --- b/core/lib/Drupal/Core/Requirements.php +++ b/core/lib/Drupal/Core/Requirements.php @@ -32,2 +32,13 @@ + /** + * Minimum supported version of PHP. + * + * Below this version: + * - New sites cannot be installed, except from within tests. + * - Updates from previous Drupal versions can be run, but users are warned + * that Drupal no longer supports that PHP version. + * - An error is shown in the status report that the PHP version is too old. + */ + const MINIMUM_SUPPORTED_PHP = '7.0.8'; + } diff -u b/core/modules/system/system.install b/core/modules/system/system.install --- b/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -187,10 +187,10 @@ } // Check if the PHP version is below what Drupal supports. - if (version_compare($phpversion, DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { + if (version_compare($phpversion, Requirements::MINIMUM_SUPPORTED_PHP) < 0) { $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version. It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See PHP\'s version support documentation and the Drupal 8 PHP requirements handbook page for more information.', [ - '%version' => DRUPAL_MINIMUM_SUPPORTED_PHP, + '%version' => Requirements::MINIMUM_SUPPORTED_PHP, '%recommended' => Requirements::RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/8/system-requirements/php', ] only in patch2: unchanged: --- a/core/composer.json +++ b/core/composer.json @@ -225,7 +225,8 @@ "lib/Drupal/Core/DrupalKernel.php", "lib/Drupal/Core/DrupalKernelInterface.php", "lib/Drupal/Core/Site/Settings.php" - ] + ], + "files": ["lib/autoloader.php"] }, "config": { "preferred-install": "dist", only in patch2: unchanged: --- /dev/null +++ b/core/lib/autoloader.php @@ -0,0 +1,14 @@ +system requirements page for more information.'; + exit; +}