bug 21076: b/c, make 'undelete' work without 'deletedtext'
[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 define( 'MW_CMDLINE_CALLBACK', 'wfSetupUpdateScript' );
14 $wgUseMasterForMaintenance = true;
15 require_once( dirname(__FILE__) . '/commandLine.inc' );
16 require( "updaters.inc" );
17
18 $wgTitle = Title::newFromText( "MediaWiki database updater" );
19
20 echo( "MediaWiki {$wgVersion} Updater\n\n" );
21
22 install_version_checks();
23
24 # Attempt to connect to the database as a privileged user
25 # This will vomit up an error if there are permissions problems
26 $wgDatabase = wfGetDB( DB_MASTER );
27
28 print "Going to run database updates for ".wfWikiID()."\n";
29 print "Depending on the size of your database this may take a while!\n";
30
31 if( !isset( $options['quick'] ) ) {
32 print "Abort with control-c in the next five seconds... ";
33 wfCountDown( 5 );
34 }
35
36 $shared = isset( $options['doshared'] );
37 $purge = !isset( $options['nopurge'] );
38
39 do_all_updates( $shared, $purge );
40
41 print "Done.\n";
42
43 function wfSetupUpdateScript() {
44 global $wgLocalisationCacheConf;
45
46 # Don't try to access the database
47 # This needs to be disabled early since extensions will try to use the l10n
48 # cache from $wgExtensionSetupFunctions (bug 20471)
49 $wgLocalisationCacheConf = array(
50 'class' => 'LocalisationCache',
51 'storeClass' => 'LCStore_Null',
52 'storeDirectory' => false,
53 'manualRecache' => false,
54 );
55 }