diff options
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 |