X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2Fupdate.php;h=9f2fb929e74f5db2d79829a72b0befef3ecef601;hb=574ae4929e30700e29fef0e0d4f4824599205174;hp=a672e294e7dd87c14038b2dea25c1121c8b12b4d;hpb=8803fab2707184a1e26e676afdecff7f296b78d1;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/update.php b/maintenance/update.php index a672e294e7..9f2fb929e7 100755 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -27,6 +27,8 @@ require_once __DIR__ . '/Maintenance.php'; +use Wikimedia\Rdbms\IMaintainableDatabase; + /** * Maintenance script to run database schema updates. * @@ -112,7 +114,7 @@ class UpdateMediaWiki extends Maintenance { } $lang = Language::factory( 'en' ); - // Set global language to ensure localised errors are in English (bug 20633) + // Set global language to ensure localised errors are in English (T22633) RequestContext::getMain()->setLanguage( $lang ); $wgLang = $lang; // BackCompat @@ -143,9 +145,19 @@ 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 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 Database|DatabaseSqlite $db */ + /** @var IMaintainableDatabase|DatabaseSqlite $db */ $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" ); } $this->output( "Depending on the size of your database this may take a while!\n" ); @@ -203,7 +215,7 @@ class UpdateMediaWiki extends Maintenance { # Don't try to access the database # This needs to be disabled early since extensions will try to use the l10n - # cache from $wgExtensionFunctions (bug 20471) + # cache from $wgExtensionFunctions (T22471) $wgLocalisationCacheConf = [ 'class' => 'LocalisationCache', 'storeClass' => 'LCStoreNull',