summaryrefslogtreecommitdiff
path: root/includes/installer
diff options
context:
space:
mode:
Diffstat (limited to 'includes/installer')
-rw-r--r--includes/installer/Installer.i18n.php9
-rw-r--r--includes/installer/Installer.php22
2 files changed, 24 insertions, 7 deletions
diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php
index 16e83e4f..a9971b4f 100644
--- a/includes/installer/Installer.i18n.php
+++ b/includes/installer/Installer.i18n.php
@@ -124,8 +124,9 @@ It may cause problems, particularly if using file uploads and <code>math</code>
'config-xml-bad' => "PHP's XML module is missing.
MediaWiki requires functions in this module and will not work in this configuration.
If you're running Mandrake, install the php-xml package.",
- 'config-pcre' => 'The PCRE support module appears to be missing.
-MediaWiki requires the Perl-compatible regular expression functions to work.',
+ 'config-pcre-old' => "'''Fatal:''' PCRE $1 or later is required.
+Your PHP binary is linked with PCRE $2.
+[https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms/PCRE More information].",
'config-pcre-no-utf8' => "'''Fatal:''' PHP's PCRE module seems to be compiled without PCRE_UTF8 support.
MediaWiki requires UTF-8 support to function correctly.",
'config-memory-raised' => "PHP's <code>memory_limit</code> is $1, raised to $2.",
@@ -651,6 +652,10 @@ Parameters:
'config-mbstring' => '{{Related|Config-fatal}}',
'config-ze1' => '{{Related|Config-fatal}}',
'config-pcre' => 'PCRE is an initialism for "Perl-compatible regular expression". Perl is programming language whose [[:w:regular expression|regular expression]] syntax is popular and used in other languages using a library called PCRE.',
+ 'config-pcre-old' => 'Parameters:
+* $1 - minimum PCRE version number
+* $2 - the installed version of [[wikipedia:PCRE|PCRE]]
+{{Related|Config-fatal}}',
'config-pcre-no-utf8' => "PCRE is a name of a programmers' library for supporting regular expressions. It can probably be translated without change.
{{Related|Config-fatal}}",
'config-memory-raised' => 'Parameters:
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 62bb2ec4..f248d859 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -42,6 +42,14 @@ abstract class Installer {
const MINIMUM_PHP_VERSION = '5.3.2';
/**
+ * The oldest version of PCRE we can support.
+ *
+ * Defining this is necessary because PHP may be linked with a system version
+ * of PCRE, which may be older than that bundled with the minimum PHP version.
+ */
+ const MINIMUM_PCRE_VERSION = '7.2';
+
+ /**
* @var array
*/
protected $settings;
@@ -416,6 +424,15 @@ abstract class Installer {
$good = false;
}
+ // Must go here because an old version of PCRE can prevent other checks from completing
+ if ( $good ) {
+ list( $pcreVersion ) = explode( ' ', PCRE_VERSION, 2 );
+ if ( version_compare( $pcreVersion, self::MINIMUM_PCRE_VERSION, '<' ) ) {
+ $this->showError( 'config-pcre-old', self::MINIMUM_PCRE_VERSION, $pcreVersion );
+ $good = false;
+ }
+ }
+
if ( $good ) {
foreach ( $this->envChecks as $check ) {
$status = $this->$check();
@@ -826,11 +843,6 @@ abstract class Installer {
* @return bool
*/
protected function envCheckPCRE() {
- if ( !function_exists( 'preg_match' ) ) {
- $this->showError( 'config-pcre' );
-
- return false;
- }
wfSuppressWarnings();
$regexd = preg_replace( '/[\x{0430}-\x{04FF}]/iu', '', '-АБВГД-' );
// Need to check for \p support too, as PCRE can be compiled