Verified Commit d22061d0 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 2448cd3e.
parent e7fea5d1
Loading
Loading
Loading
Loading
+1 −2
Changes for core/includes/bootstrap.inc: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -43,10 +43,9 @@
 * - An error is shown in the status report that the PHP version is too old.
 *
 * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
 *   \Drupal\Core\Utility\PhpRequirements::getMinimumSupportedPhp() instead.
 *   \Drupal::MINIMUM_SUPPORTED_PHP instead.
 *
 * @see https://www.drupal.org/node/2909361
 * @see https://www.drupal.org/node/3261451
 */
const DRUPAL_MINIMUM_SUPPORTED_PHP = \Drupal::MINIMUM_SUPPORTED_PHP;

+5 −4
Changes for core/lib/Drupal.php: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -90,10 +90,11 @@ class Drupal {
  /**
   * Minimum supported version of PHP.
   *
   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use
   *   \Drupal\Core\Utility\PhpRequirements::getMinimumSupportedPhp() instead.
   *
   * @see https://www.drupal.org/node/3261451
   * 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.4.0';

−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
@@ -18,7 +18,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;
@@ -34,10 +33,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');
@@ -291,10 +286,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');
    }

Loading