X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseInstaller.php;h=e6ee70edfd63c8ca47777411f7449c38e2c675a8;hb=d3012989672f82dcb51792b9e9fc6bd85124da5a;hp=d4150c87ab8af9dbd855418314b114c6148290d3;hpb=858d9cc5097c0e87992ff4b060ca1411fadedb5e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index d4150c87ab..e6ee70edfd 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -41,6 +41,16 @@ abstract class DatabaseInstaller { */ public $parent; + /** + * @var string Set by subclasses + */ + public static $minimumVersion; + + /** + * @var string Set by subclasses + */ + protected static $notMiniumumVerisonMessage; + /** * The database connection. * @@ -62,6 +72,23 @@ abstract class DatabaseInstaller { */ protected $globalNames = []; + /** + * Whether the provided version meets the necessary requirements for this type + * + * @param string $serverVersion Output of Database::getServerVersion() + * @return Status + * @since 1.30 + */ + public static function meetsMinimumRequirement( $serverVersion ) { + if ( version_compare( $serverVersion, static::$minimumVersion ) < 0 ) { + return Status::newFatal( + static::$notMiniumumVerisonMessage, static::$minimumVersion, $serverVersion + ); + } + + return Status::newGood(); + } + /** * Return the internal name, e.g. 'mysql', or 'sqlite'. */ @@ -703,10 +730,10 @@ abstract class DatabaseInstaller { return $status; } global $IP; - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $rows = file( "$IP/maintenance/interwiki.list", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); $interwikis = []; if ( !$rows ) { return Status::newFatal( 'config-install-interwiki-list' );