00001 <?php 00013 define( 'MW_CMDLINE_CALLBACK', 'wfSetupUpdateScript' ); 00014 $wgUseMasterForMaintenance = true; 00015 require_once( dirname(__FILE__) . '/commandLine.inc' ); 00016 require( "updaters.inc" ); 00017 00018 $wgTitle = Title::newFromText( "MediaWiki database updater" ); 00019 00020 echo( "MediaWiki {$wgVersion} Updater\n\n" ); 00021 00022 if( !isset( $options['skip-compat-checks'] ) ) { 00023 install_version_checks(); 00024 } else { 00025 print "Skipping compatibility checks, proceed at your own risk (Ctrl+C to abort)\n"; 00026 wfCountdown(5); 00027 } 00028 00029 # Attempt to connect to the database as a privileged user 00030 # This will vomit up an error if there are permissions problems 00031 $wgDatabase = wfGetDB( DB_MASTER ); 00032 00033 print "Going to run database updates for ".wfWikiID()."\n"; 00034 print "Depending on the size of your database this may take a while!\n"; 00035 00036 if( !isset( $options['quick'] ) ) { 00037 print "Abort with control-c in the next five seconds (skip this countdown with --quick) ... "; 00038 wfCountDown( 5 ); 00039 } 00040 00041 $shared = isset( $options['doshared'] ); 00042 $purge = !isset( $options['nopurge'] ); 00043 00044 do_all_updates( $shared, $purge ); 00045 00046 print "Done.\n"; 00047 00048 function wfSetupUpdateScript() { 00049 global $wgLocalisationCacheConf; 00050 00051 # Don't try to access the database 00052 # This needs to be disabled early since extensions will try to use the l10n 00053 # cache from $wgExtensionSetupFunctions (bug 20471) 00054 $wgLocalisationCacheConf = array( 00055 'class' => 'LocalisationCache', 00056 'storeClass' => 'LCStore_Null', 00057 'storeDirectory' => false, 00058 'manualRecache' => false, 00059 ); 00060 }