diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-02-01 21:35:16 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-02-01 21:35:16 -0500 |
commit | 064cec79ca4c8201de0d06bbca6cb7a5345d11be (patch) | |
tree | 1d2221b7d5fe2744d82d1241a736a9d9b0666ded /includes/installer/Installer.php | |
parent | 5744df39e15f85c6cc8a9faf8924d77e76d2b216 (diff) | |
parent | 1b65fa2a5f4c48b02ceda934e9c1aee2d03ce453 (diff) |
Merge branch 'archwiki'
Diffstat (limited to 'includes/installer/Installer.php')
-rw-r--r-- | includes/installer/Installer.php | 22 |
1 files changed, 17 insertions, 5 deletions
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 |