8816f9433103cacdeadcbcbc0644ca8f01a49370
[lhc/web/wiklou.git] / maintenance / update.php
1 <?php
2 /**
3 * Run all updaters.
4 *
5 * This is used when the database schema is modified and we need to apply patches.
6 *
7 * @file
8 * @todo document
9 * @ingroup Maintenance
10 */
11
12 /** */
13 $wgUseMasterForMaintenance = true;
14 require( "commandLine.inc" );
15 require( "updaters.inc" );
16 $wgTitle = Title::newFromText( "MediaWiki database updater" );
17
18 echo( "MediaWiki {$wgVersion} Updater\n\n" );
19
20 install_version_checks();
21
22 # Attempt to connect to the database as a privileged user
23 # This will vomit up an error if there are permissions problems
24 $wgDatabase = wfGetDB( DB_MASTER );
25
26 print "Going to run database updates for ".wfWikiID()."\n";
27 print "Depending on the size of your database this may take a while!\n";
28
29 if( !isset( $options['quick'] ) ) {
30 print "Abort with control-c in the next five seconds... ";
31 wfCountDown( 5 );
32 }
33
34 $shared = isset( $options['doshared'] );
35 $purge = !isset( $options['nopurge'] );
36
37 do_all_updates( $shared, $purge );
38
39 print "Done.\n";
40
41