You are here

constant Drupal::MINIMUM_PHP in Drupal 10

Same name and namespace in other branches
  1. 9 core/lib/Drupal.php \Drupal::MINIMUM_PHP

Minimum allowed version of PHP for Drupal to be bootstrapped.

Below this version:

  • The installer cannot be run.
  • Updates cannot be run.
  • Modules and themes cannot be enabled.
  • 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.

Note: To prevent the installer from having fatal errors on older versions of PHP, the value of this constant is hardcoded twice in core/install.php:

  • Once as a parameter of version_compare()
  • Once in the error message printed to the user immediately after.

Remember to update both whenever this constant is updated.

10 uses of Drupal::MINIMUM_PHP
ComposerTest::testEnsurePhpConfiguredVersion in core/tests/Drupal/Tests/Composer/ComposerTest.php
Ensure that the configured php version matches the minimum php version.
DrupalTest::testPhpConstants in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the PHP constants have consistent values.
hook_requirements in core/lib/Drupal/Core/Extension/module.api.php
Check installation requirements and do status reporting.
install_profile_info in core/includes/install.inc
Retrieves information about an installation profile from its .info.yml file.
ModuleExtensionList.php in core/lib/Drupal/Core/Extension/ModuleExtensionList.php

... See full list

File

core/lib/Drupal.php, line 106

Class

Drupal
Static Service Container wrapper.

Code

const MINIMUM_PHP = '8.1.0';