Verified Commit 73a5d20e authored by Jess's avatar Jess
Browse files

Revert "Issue #3261447 by xjm, lauriii, ravi.shankar, Wim Leers, alexpott,...

Revert "Issue #3261447 by xjm, lauriii, ravi.shankar, Wim Leers, alexpott, tedbow, daffie: Add an API for dynamically setting recommended and supported PHP versions based on known and predicted PHP release schedules"

This reverts commit 3412b7bd.
parent 732d41f6
Loading
Loading
Loading
Loading
+11
Changes for core/lib/Drupal.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -87,6 +87,17 @@ class Drupal {
   */
  const CORE_MINIMUM_SCHEMA_VERSION = 8000;

  /**
   * 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 = '8.1.0';

  /**
   * Minimum allowed version of PHP for Drupal to be bootstrapped.
   *
−109

File deleted.

+2 −7
Changes for core/modules/system/system.install: 2 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
use Drupal\Core\Extension\ExtensionLifecycle;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Link;
use Drupal\Core\Utility\PhpRequirements;
use Drupal\Core\Render\Markup;
use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PrivateStream;
@@ -32,10 +31,6 @@
 */
function system_requirements($phase) {
  global $install_state;

  // Get the current default PHP requirements for this version of Drupal.
  $minimum_supported_php = PhpRequirements::getMinimumSupportedPhp();

  // Reset the extension lists.
  /** @var \Drupal\Core\Extension\ModuleExtensionList $module_extension_list */
  $module_extension_list = \Drupal::service('extension.list.module');
@@ -289,10 +284,10 @@ function system_requirements($phase) {
  }

  // Check if the PHP version is below what Drupal supports.
  if (version_compare($phpversion, $minimum_supported_php) < 0) {
  if (version_compare($phpversion, \Drupal::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 <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href=":php_requirements">Drupal PHP requirements</a> page for more information.',
      [
        '%version' => $minimum_supported_php,
        '%version' => \Drupal::MINIMUM_SUPPORTED_PHP,
        '%recommended' => \Drupal::RECOMMENDED_PHP,
        ':php_requirements' => 'https://www.drupal.org/docs/system-requirements/php-requirements',
      ]
+3 −5
Changes for core/modules/system/tests/src/Functional/System/PhpRequirementTest.php: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@

namespace Drupal\Tests\system\Functional\System;

use Drupal\Core\Utility\PhpRequirements;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\RequirementsPageTrait;

@@ -48,7 +47,6 @@ protected function setUp(): void {
   * Tests status report messages regarding the PHP version.
   */
  public function testStatusPage() {
    $minimum_php_version = PhpRequirements::getMinimumSupportedPhp();
    // Go to Administration.
    $this->drupalGet('admin/reports/status');
    $this->assertSession()->statusCodeEquals(200);
@@ -59,13 +57,13 @@ public function testStatusPage() {

    // Verify that an error is displayed about the PHP version if it is below
    // the minimum supported PHP.
    if (version_compare($phpversion, $minimum_php_version) < 0) {
    if (version_compare($phpversion, \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
      $this->assertErrorSummaries(['PHP']);
      $this->assertSession()->pageTextContains('Your PHP installation is too old. Drupal requires at least PHP ' . $minimum_php_version);
      $this->assertSession()->pageTextContains('Your PHP installation is too old. Drupal requires at least PHP ' . \Drupal::MINIMUM_SUPPORTED_PHP);
    }
    // Otherwise, there should be no error.
    else {
      $this->assertSession()->pageTextNotContains('Your PHP installation is too old. Drupal requires at least PHP ' . $minimum_php_version);
      $this->assertSession()->pageTextNotContains('Your PHP installation is too old. Drupal requires at least PHP ' . \Drupal::MINIMUM_SUPPORTED_PHP);
      $this->assertSession()->pageTextNotContains('Errors found');
    }

+1 −2
Changes for core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
use Drupal\Core\Session\UserSession;
use Drupal\Core\Site\Settings;
use Drupal\Core\Test\HttpClientMiddleware\TestHttpClientMiddleware;
use Drupal\Core\Utility\PhpRequirements;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\RequirementsPageTrait;
use GuzzleHttp\HandlerStack;
@@ -253,7 +252,7 @@ protected function setUpSettings() {
   * @see system_requirements()
   */
  protected function setUpRequirementsProblem() {
    if (version_compare(phpversion(), PhpRequirements::getMinimumSupportedPhp()) < 0) {
    if (version_compare(phpversion(), \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
      $this->continueOnExpectedWarnings(['PHP']);
    }
  }
Loading