From 934e7e6df10dbe809a8d088dbf8ac96562e35b42 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 10 Sep 2010 16:53:35 +0000 Subject: [PATCH] Use the AutoLoader instead of manually requiring these files --- includes/AutoLoader.php | 8 ++++++++ maintenance/FiveUpgrade.inc | 1 - maintenance/updaters.inc | 15 ++++----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index a994880307..7f329568ac 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -678,6 +678,7 @@ $wgAutoloadLocalClasses = array( # maintenance 'AnsiTermColorer' => 'maintenance/parserTests.inc', + 'ConvertLinks' => 'maintenance/convertLinks.php', 'DbTestPreviewer' => 'maintenance/parserTests.inc', 'DbTestRecorder' => 'maintenance/parserTests.inc', 'DeleteArchivedFilesImplementation' => 'maintenance/deleteArchivedFiles.inc', @@ -687,11 +688,18 @@ $wgAutoloadLocalClasses = array( 'ParserTest' => 'maintenance/parserTests.inc', 'ParserTestParserHook' => 'maintenance/parserTestsParserHook.php', 'ParserTestStaticParserHook' => 'maintenance/parserTestsStaticParserHook.php', + 'PopulateCategory' => 'maintenance/populateCategory.php', + 'PopulateLogSearch' => 'maintenance/populateLogSearch.php', + 'PopulateParentId' => 'maintenance/populateParentId.php', + 'PopulateRevisionLength' => 'maintenance/populateRevisionLength.php', 'RemoteTestRecorder' => 'maintenance/parserTests.inc', 'SevenZipStream' => 'maintenance/7zip.inc', 'Sqlite' => 'maintenance/sqlite.inc', 'TestFileIterator' => 'maintenance/parserTests.inc', 'TestRecorder' => 'maintenance/parserTests.inc', + 'UpdateCollation' => 'maintenance/updateCollation.php', + 'UpdateRestrictions' => 'maintenance/updateRestrictions.php', + 'UserDupes' => 'maintenance/userDupes.inc', # maintenance/tests/selenium 'SimpleSeleniumTestSuite' => 'maintenance/tests/selenium/SimpleSeleniumTestSuite.php', diff --git a/maintenance/FiveUpgrade.inc b/maintenance/FiveUpgrade.inc index 5eebb0e881..6723bd9f5d 100644 --- a/maintenance/FiveUpgrade.inc +++ b/maintenance/FiveUpgrade.inc @@ -5,7 +5,6 @@ */ require_once( 'cleanupDupes.inc' ); -require_once( 'userDupes.inc' ); require_once( 'updaters.inc' ); define( 'MW_UPGRADE_COPY', false ); diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 67b9cac221..b657b6d134 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -393,10 +393,6 @@ function do_pagelinks_namespace( $namespace ) { } function do_old_links_update() { - if( !defined( 'MW_NO_SETUP' ) ) { - define( 'MW_NO_SETUP', true ); - } - require( "convertLinks.php" ); $cl = new ConvertLinks(); $cl->execute(); } @@ -416,7 +412,6 @@ function fix_ancient_imagelinks() { function do_user_unique_update() { $dbw = wfGetDB( DB_MASTER ); - require_once( "userDupes.inc" ); $duper = new UserDupes( $dbw ); if ( $duper->hasUniqueIndex() ) { wfOut( "...already have unique user_name index.\n" ); @@ -710,7 +705,6 @@ function do_restrictions_update() { wfOut( "ok\n" ); wfOut( "Migrating old restrictions to new table...\n" ); - require_once( 'updateRestrictions.php' ); $task = new UpdateRestrictions(); $task->execute(); } @@ -721,7 +715,7 @@ function do_category_population() { wfOut( "...category table already populated.\n" ); return; } - require_once( 'populateCategory.php' ); + wfOut( "Populating category table, printing progress markers. " . "For large databases, you\n" . @@ -738,7 +732,7 @@ function do_populate_parent_id() { wfOut( "...rev_parent_id column already populated.\n" ); return; } - require_once( 'populateParentId.php' ); + $task = new PopulateParentId(); $task->execute(); } @@ -748,7 +742,7 @@ function do_populate_rev_len() { wfOut( "...rev_len column already populated.\n" ); return; } - require_once( 'populateRevisionLength.php' ); + $task = new PopulateRevisionLength(); $task->execute(); } @@ -775,7 +769,7 @@ function do_collation_update() { wfOut( "...collations up-to-date.\n" ); return; } - require_once( 'updateCollation.php' ); + $task = new UpdateCollation(); $task->execute(); } @@ -826,7 +820,6 @@ function do_log_search_population() { wfOut( "...log_search table already populated.\n" ); return; } - require_once( 'populateLogSearch.php' ); wfOut( "Populating log_search table, printing progress markers. For large\n" . "databases, you may want to hit Ctrl-C and do this manually with\n" . -- 2.20.1