Rewrite various TableCleanup scripts to subclass Maintenance instead of FiveUpgrade
[mediawiki.git] / maintenance / update.php
blobc473153e19f58a4808525bf178740e7f1b38d5c2
1 <?php
2 /**
3 * Run all updaters.
5 * This is used when the database schema is modified and we need to apply patches.
7 * @file
8 * @todo document
9 * @ingroup Maintenance
12 /** */
13 $wgUseMasterForMaintenance = true;
14 require_once( dirname(__FILE__) . '/commandLine.inc' );
15 require( "updaters.inc" );
17 # Don't try to load stuff from l10n_cache yet
18 $lc = Language::getLocalisationCache();
19 $lc->disableBackend();
21 $wgTitle = Title::newFromText( "MediaWiki database updater" );
23 echo( "MediaWiki {$wgVersion} Updater\n\n" );
25 install_version_checks();
27 # Attempt to connect to the database as a privileged user
28 # This will vomit up an error if there are permissions problems
29 $wgDatabase = wfGetDB( DB_MASTER );
31 print "Going to run database updates for ".wfWikiID()."\n";
32 print "Depending on the size of your database this may take a while!\n";
34 if( !isset( $options['quick'] ) ) {
35 print "Abort with control-c in the next five seconds... ";
36 wfCountDown( 5 );
39 $shared = isset( $options['doshared'] );
40 $purge = !isset( $options['nopurge'] );
42 do_all_updates( $shared, $purge );
44 print "Done.\n";