Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295737

Move some of the bootstrap.inc PHP-related constants to \Drupal and deprecate the old versions

$
0
0

Problem/Motivation

This is a follow-up to #2843328: Enforce minimum PHP version in composer dependencies

In that issue, we learned that it's hard to unit-test against the minimum PHP requirement for Drupal.

That's because the DRUPAL_MINIMUM_PHP constant lives in core/includes/bootstrap.inc, which is not autoloadable in unit tests.

This is also true of DRUPAL_MINIMUM_PHP_MEMORY_LIMIT.

This kind of awkward constant definition leads to the solution in #2843328: Enforce minimum PHP version in composer dependencies which is to define a similar constant on the test class, and also to re-definitions of constants as in ThemeHandlerTest.

Also this true of DRUPAL_MINIMUM_SUPPORTED_PHP and DRUPAL_RECOMMENDED_PHP that introduced in #3039287: Implement changes required to remove support for PHP 5.5 and 5.6

Proposed resolution

Deprecate these constants in bootstrap.inc.

Move the constants to an appropriate autoloadable class. This could be in the installer system or \Drupal, or a constants-only class designed for this purpose.
Update: The chosen solution is to add 4 constants to the class \Drupal.

Remaining tasks

Follow-up to remove usages of deprecated constants.

User interface changes

None

API changes

Deprecates DRUPAL_MINIMUM_PHP, DRUPAL_MINIMUM_SUPPORTED_PHP, DRUPAL_RECOMMENDED_PHP and DRUPAL_MINIMUM_PHP_MEMORY_LIMIT

Adds to the class Drupal the following 4 constants: \Drupal::MINIMUM_PHP, \Drupal::MINIMUM_SUPPORTED_PHP, \Drupal::RECOMMENDED_PHP and \Drupal::PHP_MEMORY_LIMIT

Data model changes

None.


Viewing all articles
Browse latest Browse all 295737


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>