aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/update.php
diff options
context:
space:
mode:
authorKunal Mehta <legoktm@member.fsf.org>2017-10-02 22:14:33 -0700
committerKunal Mehta <legoktm@member.fsf.org>2017-10-02 22:23:32 -0700
commit574ae4929e30700e29fef0e0d4f4824599205174 (patch)
treea006d128ff4e32846e7035ef5aba2b79ea25af20 /maintenance/update.php
parent6e067e541154d3c4c1decbe12f602177d4f38aeb (diff)
downloadmediawikicore-574ae4929e30700e29fef0e0d4f4824599205174.tar.gz
mediawikicore-574ae4929e30700e29fef0e0d4f4824599205174.zip
Check minimum database server version when running update.php
If MediaWiki has increased the minimum database server version that is required, check it when running update.php to ensure it is still compatible. Previously this was only checked during the installer. Bug: T162044 Change-Id: I47092c9557f4706a4dcb3a23150647e68af4317f
Diffstat (limited to 'maintenance/update.php')
-rwxr-xr-xmaintenance/update.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/maintenance/update.php b/maintenance/update.php
index 5f705ba371a6..9f2fb929e74f 100755
--- a/maintenance/update.php
+++ b/maintenance/update.php
@@ -145,6 +145,16 @@ class UpdateMediaWiki extends Maintenance {
# This will vomit up an error if there are permissions problems
$db = $this->getDB( DB_MASTER );
+ # Check to see whether the database server meets the minimum requirements
+ /** @var DatabaseInstaller $dbInstallerClass */
+ $dbInstallerClass = Installer::getDBInstallerClass( $db->getType() );
+ $status = $dbInstallerClass::meetsMinimumRequirement( $db->getServerVersion() );
+ if ( !$status->isOK() ) {
+ // This might output some wikitext like <strong> but it should be comprehensible
+ $text = $status->getWikiText();
+ $this->error( $text, 1 );
+ }
+
$this->output( "Going to run database updates for " . wfWikiID() . "\n" );
if ( $db->getType() === 'sqlite' ) {
/** @var IMaintainableDatabase|DatabaseSqlite $db */