Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -876,7 +876,7 @@ |
877 | 877 | function do_stats_init() { |
878 | 878 | // Sometimes site_stats table is not properly populated. |
879 | 879 | global $wgDatabase; |
880 | | - wfOut( "Checking site_stats row..." ); |
| 880 | + wfOut( "\nChecking site_stats row..." ); |
881 | 881 | $row = $wgDatabase->selectRow( 'site_stats', '*', array( 'ss_row_id' => 1 ), __METHOD__ ); |
882 | 882 | if ( $row === false ) { |
883 | 883 | wfOut( "data is missing! rebuilding...\n" ); |
— | — | @@ -915,7 +915,7 @@ |
916 | 916 | } |
917 | 917 | |
918 | 918 | function do_all_updates( $shared = false, $purge = true ) { |
919 | | - global $wgSharedDB, $wgSharedTables, $wgDatabase, $wgDBtype; |
| 919 | + global $wgDatabase, $wgDBtype; |
920 | 920 | |
921 | 921 | $updater = DatabaseUpdater::newForDb( $wgDatabase, $shared ); |
922 | 922 | |
— | — | @@ -923,18 +923,18 @@ |
924 | 924 | |
925 | 925 | $updater->doUpdates(); |
926 | 926 | |
| 927 | + if ( !defined( 'MW_NO_SETUP' ) ) { |
| 928 | + define( 'MW_NO_SETUP', true ); |
| 929 | + } |
| 930 | + |
| 931 | + foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) { |
| 932 | + call_user_func_array( array( new $maint, 'execute' ), array() ); |
| 933 | + } |
| 934 | + |
927 | 935 | if ( $wgDBtype === 'postgres' ) { |
928 | 936 | return; |
929 | 937 | } |
930 | 938 | |
931 | | - wfOut( "Deleting old default messages (this may take a long time!)..." ); |
932 | | - if ( !defined( 'MW_NO_SETUP' ) ) { |
933 | | - define( 'MW_NO_SETUP', true ); |
934 | | - } |
935 | | - require_once 'deleteDefaultMessages.php'; |
936 | | - DeleteDefaultMessages::reallyExecute(); |
937 | | - wfOut( "Done\n" ); |
938 | | - |
939 | 939 | do_stats_init(); |
940 | 940 | |
941 | 941 | if ( $purge ) { |
Index: trunk/phase3/maintenance/deleteDefaultMessages.php |
— | — | @@ -31,10 +31,9 @@ |
32 | 32 | } |
33 | 33 | |
34 | 34 | public function execute() { |
35 | | - self::reallyExecute(); |
36 | | - } |
37 | | - |
38 | | - public static function reallyExecute() { |
| 35 | + |
| 36 | + $this->output( 'Deleting old default messages (this may take a long time!)...', 'msg' ); |
| 37 | + |
39 | 38 | $user = 'MediaWiki default'; |
40 | 39 | $reason = 'No longer required'; |
41 | 40 | |
— | — | @@ -65,6 +64,8 @@ |
66 | 65 | $article->doDeleteArticle( $reason ); |
67 | 66 | $dbw->commit(); |
68 | 67 | } |
| 68 | + |
| 69 | + $this->output( 'done!', 'msg' ); |
69 | 70 | } |
70 | 71 | } |
71 | 72 | |
Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -20,6 +20,10 @@ |
21 | 21 | |
22 | 22 | protected $shared = false; |
23 | 23 | |
| 24 | + protected $postDatabaseUpdateMaintenance = array( |
| 25 | + 'DeleteDefaultMessages' |
| 26 | + ); |
| 27 | + |
24 | 28 | protected function __construct( $db, $shared ) { |
25 | 29 | $this->db = $db; |
26 | 30 | $this->shared = $shared; |
— | — | @@ -37,6 +41,10 @@ |
38 | 42 | |
39 | 43 | public function getDB() { return $this->db; } |
40 | 44 | |
| 45 | + public function getPostDatabaseUpdateMaintenance() { |
| 46 | + return $this->postDatabaseUpdateMaintenance; |
| 47 | + } |
| 48 | + |
41 | 49 | public function doUpdates() { |
42 | 50 | global $IP, $wgVersion; |
43 | 51 | require_once( "$IP/maintenance/updaters.inc" ); |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -668,6 +668,7 @@ |
669 | 669 | 'DbTestRecorder' => 'maintenance/parserTests.inc', |
670 | 670 | 'DeleteArchivedFilesImplementation' => 'maintenance/deleteArchivedFiles.inc', |
671 | 671 | 'DeleteArchivedRevisionsImplementation' => 'maintenance/deleteArchivedRevisions.inc', |
| 672 | + 'DeleteDefaultMessages' => 'maintenance/deleteDefaultMessages.php', |
672 | 673 | 'DummyTermColorer' => 'maintenance/parserTests.inc', |
673 | 674 | 'ParserTest' => 'maintenance/parserTests.inc', |
674 | 675 | 'ParserTestParserHook' => 'maintenance/parserTestsParserHook.php', |