Skip to content
Snippets Groups Projects
Commit 43cb1b5c authored by catch's avatar catch
Browse files

Issue #3053363 by alexpott, Wim Leers, Berdir, mondrake, xjm: Remove support...

Issue #3053363 by alexpott, Wim Leers, Berdir, mondrake, xjm: Remove support for PHP 5 in Drupal 8.8
parent e46168f2
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 91 deletions
......@@ -2,11 +2,8 @@
SQLITE REQUIREMENTS
-------------------
To use SQLite with your Drupal installation, the following requirements must be
met: Server has PHP 5.3.10 or later with PDO, and the PDO SQLite driver must be
enabled.
If you have not pdo_sqlite available depending on your system there are different ways to install it.
PHP's PDO SQLite driver must be enabled. If you do not have pdo_sqlite
available, depending on your system there are different ways to install it.
Windows
-------
......
......@@ -15,7 +15,7 @@ QUICKSTART
----------------------
Prerequisites:
- PHP 5.5.9 (or greater) (https://php.net).
- PHP 7.0.8 (or greater) (https://php.net).
In the instructions below, replace the version x.y.z with the specific version
you wish to download. Example: 8.6.0.zip. You can find the latest stable version
......@@ -48,8 +48,8 @@ Drupal requires:
- A web server with PHP support, for example:
- Apache 2.0 (or greater) (http://httpd.apache.org/).
- Nginx 1.1 (or greater) (http://nginx.com/).
- PHP 5.5.9 (or greater) (http://php.net/). For better security support it is
recommended to update to at least 5.5.21 or 5.6.5.
- PHP 7.0.8 (or greater) (http://php.net/). For better security support it is
recommended to update to at least 7.2.17.
- One of the following databases:
- MySQL 5.5.3 (or greater) (http://www.mysql.com/).
- MariaDB 5.5.20 (or greater) (https://mariadb.org/). MariaDB is a fully
......@@ -93,10 +93,6 @@ OPTIONAL SERVER REQUIREMENTS
configuration allows the web server to initiate outbound connections. Most web
hosting setups allow this.
- PHP 5.5.21 provides features for improved security when used with MySQL. While
this is not required, it is highly encouraged to use PHP 5.5.21 or 5.6.5 and
above.
INSTALLATION
------------
......
......@@ -17,7 +17,7 @@
"ext-SPL": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
"php": "^5.5.9|>=7.0.8",
"php": ">=7.0.8",
"symfony/class-loader": "~3.4.0",
"symfony/console": "~3.4.0",
"symfony/dependency-injection": "~3.4.26",
......
......@@ -32,7 +32,7 @@
* @todo Move this to an appropriate autoloadable class. See
* https://www.drupal.org/project/drupal/issues/2908079
*/
const DRUPAL_MINIMUM_PHP = '5.5.9';
const DRUPAL_MINIMUM_PHP = '7.0.8';
/**
* Minimum supported version of PHP.
......@@ -604,15 +604,10 @@ function _drupal_exception_handler($exception) {
// Log the message to the watchdog and return an error page to the user.
_drupal_log_error(Error::decodeException($exception), TRUE);
}
// PHP 7 introduces Throwable, which covers both Error and
// Exception throwables.
// Catch \Throwable, which covers both Error and Exception throwables.
catch (\Throwable $error) {
_drupal_exception_handler_additional($exception, $error);
}
// In order to be compatible with PHP 5 we also catch regular Exceptions.
catch (\Exception $exception2) {
_drupal_exception_handler_additional($exception, $exception2);
}
}
/**
......@@ -1057,15 +1052,10 @@ function _drupal_shutdown_function() {
next($callbacks);
}
}
// PHP 7 introduces Throwable, which covers both Error and
// Exception throwables.
// Catch \Throwable, which covers both Error and Exception throwables.
catch (\Throwable $error) {
_drupal_shutdown_function_handle_exception($error);
}
// In order to be compatible with PHP 5 we also catch regular Exceptions.
catch (\Exception $exception) {
_drupal_shutdown_function_handle_exception($exception);
}
}
/**
......
......@@ -25,8 +25,8 @@
// The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
// yet available. It is defined in bootstrap.inc, but it is not possible to
// load that file yet as it would cause a fatal error on older versions of PHP.
if (version_compare(PHP_VERSION, '5.5.9') < 0) {
print 'Your PHP installation is too old. Drupal requires at least PHP 5.5.9. See the <a href="https://www.drupal.org/requirements">system requirements</a> page for more information.';
if (version_compare(PHP_VERSION, '7.0.8') < 0) {
print 'Your PHP installation is too old. Drupal requires at least PHP 7.0.8. See the <a href="https://www.drupal.org/requirements">system requirements</a> page for more information.';
exit;
}
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"doctrine/common": "^2.5",
"doctrine/annotations": "1.2.*",
"drupal/core-file-cache": "^8.2",
......
......@@ -5,37 +5,21 @@
/**
* Handler for runtime assertion failures.
*
* This class allows PHP 5.x to throw exceptions on runtime assertion fails
* in the same manner as PHP 7, and sets the ASSERT_EXCEPTION flag to TRUE
* for the PHP 7 runtime.
*
* @ingroup php_assert
*
* @todo Deprecate this class. https://www.drupal.org/node/3054072
*/
class Handle {
/**
* Registers uniform assertion handling.
* Ensures exceptions are thrown when an assertion fails.
*/
public static function register() {
// Since we're using exceptions, turn error warnings off.
assert_options(ASSERT_WARNING, FALSE);
if (version_compare(PHP_VERSION, '7.0.0-dev') < 0) {
if (!class_exists('AssertionError', FALSE)) {
require __DIR__ . '/global_namespace_php5.php';
}
// PHP 5 - create a handler to throw the exception directly.
assert_options(ASSERT_CALLBACK, function ($file = '', $line = 0, $code = '', $message = '') {
if (empty($message)) {
$message = $code;
}
throw new \AssertionError($message, 0, NULL, $file, $line);
});
}
else {
// PHP 7 - just turn exception throwing on.
assert_options(ASSERT_EXCEPTION, TRUE);
}
// Turn exception throwing on.
assert_options(ASSERT_EXCEPTION, TRUE);
}
}
{
"name": "drupal/core-assertion",
"description": "Provides runtime assertions similar to those in PHP 7, under PHP 5.",
"description": "Provides helper functionality for runtime assertions.",
"keywords": ["drupal"],
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9"
"php": ">=7.0.8"
},
"autoload": {
"psr-4": {
......
<?php
/**
* @file
* Contains PHP5 version of the \AssertionError class.
*/
/**
* Emulates PHP 7 AssertionError as closely as possible.
*
* This class is declared in the global namespace. It will only be included by
* \Drupal\Component\Assertion\Handle for PHP5 since this class exists natively
* in PHP 7. Note that in PHP 7 it extends from Error, not Exception, but that
* isn't possible for PHP 5 - all exceptions must extend from exception.
*/
class AssertionError extends Exception {
/**
* {@inheritdoc}
*/
public function __construct($message = '', $code = 0, Exception $previous = NULL, $file = '', $line = 0) {
parent::__construct($message, $code, $previous);
// Preserve the filename and line number of the assertion failure.
$this->file = $file;
$this->line = $line;
}
}
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"zendframework/zend-feed": "^2.4"
},
"autoload": {
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"doctrine/common": "^2.5"
},
"autoload": {
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"drupal/core-utility": "^8.2"
},
"autoload": {
......
......@@ -11,7 +11,7 @@
"source": "https://www.drupal.org/project/drupal/git-instructions"
},
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"symfony/dependency-injection": ">=2.8 <4.0.0"
},
"suggest": {
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"symfony/polyfill-mbstring": "~1.0"
},
"autoload": {
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"drupal/core-file-cache": "^8.2",
"drupal/core-serialization": "^8.2"
},
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"symfony/dependency-injection": ">=2.8 <4.0.0",
"symfony/event-dispatcher": ">=2.7 <4.0.0"
},
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9"
"php": ">=7.0.8"
},
"autoload": {
"psr-4": {
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9"
"php": ">=7.0.8"
},
"autoload": {
"psr-4": {
......
......@@ -9,7 +9,7 @@
"source": "https://www.drupal.org/project/drupal/git-instructions"
},
"require": {
"php": ">=5.5.9",
"php": ">=7.0.8",
"drupal/core-utility": "^8.2"
},
"autoload": {
......
......@@ -5,7 +5,7 @@
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9"
"php": ">=7.0.8"
},
"autoload": {
"psr-4": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment