+ $shared = $this->hasOption( 'doshared' );
+ $purge = !$this->hasOption( 'nopurge' );
+
+ $updater = DatabaseUpdater::newForDb( $db, $shared );
+ $updater->doUpdates( $purge );
+
+ if ( !defined( 'MW_NO_SETUP' ) ) {
+ define( 'MW_NO_SETUP', true );
+ }
+
+ foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) {
+ call_user_func_array( array( new $maint, 'execute' ), array() );
+ }
+
+ if ( $db->getType() === 'postgres' ) {
+ return;
+ }
+
+ do_stats_init();
+
+ $this->output( "Done.\n" );
+ }
+
+ protected function afterFinalSetup() {
+ global $wgLocalisationCacheConf;
+
+ # Don't try to access the database
+ # This needs to be disabled early since extensions will try to use the l10n
+ # cache from $wgExtensionSetupFunctions (bug 20471)
+ $wgLocalisationCacheConf = array(
+ 'class' => 'LocalisationCache',
+ 'storeClass' => 'LCStore_Null',
+ 'storeDirectory' => false,
+ 'manualRecache' => false,
+ );
+ }
+}