Index: branches/maintenance-work/maintenance/attachLatest.php |
— | — | @@ -80,3 +80,5 @@ |
81 | 81 | |
82 | 82 | $maintClass = "AttachLatest"; |
83 | 83 | require_once( DO_MAINTENANCE ); |
| 84 | + |
| 85 | +ascu9a0scia-0cka,;m x;mm xm; {}lcascas |
\ No newline at end of file |
Index: branches/maintenance-work/maintenance/updateSpecialPages.php |
— | — | @@ -117,3 +117,5 @@ |
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
| 121 | +$maintClass = "UpdateSpecialPages"; |
| 122 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/maintenance/convertUserOptions.php |
— | — | @@ -50,4 +50,7 @@ |
51 | 51 | |
52 | 52 | return $id; |
53 | 53 | } |
54 | | -} |
\ No newline at end of file |
| 54 | +} |
| 55 | + |
| 56 | +$maintClass = "ConvertUserOptions"; |
| 57 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/maintenance/checkImages.php |
— | — | @@ -61,3 +61,5 @@ |
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
| 65 | +$maintClass = "CheckImages"; |
| 66 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/maintenance/Maintenance.php |
— | — | @@ -45,11 +45,18 @@ |
46 | 46 | protected $mDescription = ''; |
47 | 47 | |
48 | 48 | // Have we already loaded our user input? |
49 | | - private $inputLoaded = false; |
| 49 | + private $mInputLoaded = false; |
50 | 50 | |
51 | 51 | // Batch size. If a script supports this, they should set |
52 | 52 | // a default with setBatchSize() |
53 | 53 | protected $mBatchSize = null; |
| 54 | + |
| 55 | + /** |
| 56 | + * List of all the core maintenance scripts. This is added |
| 57 | + * to scripts added by extensions in $wgMaintenanceScripts |
| 58 | + * and returned by getMaintenanceScripts() |
| 59 | + */ |
| 60 | + protected static $mCoreScripts = null; |
54 | 61 | |
55 | 62 | /** |
56 | 63 | * Default constructor. Children should call this if implementing |
— | — | @@ -322,7 +329,7 @@ |
323 | 330 | public function clearParamsAndArgs() { |
324 | 331 | $this->mOptions = array(); |
325 | 332 | $this->mArgs = array(); |
326 | | - $this->inputLoaded = false; |
| 333 | + $this->mInputLoaded = false; |
327 | 334 | } |
328 | 335 | |
329 | 336 | /** |
— | — | @@ -338,21 +345,21 @@ |
339 | 346 | # If we were given opts or args, set those and return early |
340 | 347 | if( $self ) { |
341 | 348 | $this->mSelf = $self; |
342 | | - $this->inputLoaded = true; |
| 349 | + $this->mInputLoaded = true; |
343 | 350 | } |
344 | 351 | if( $opts ) { |
345 | 352 | $this->mOptions = $opts; |
346 | | - $this->inputLoaded = true; |
| 353 | + $this->mInputLoaded = true; |
347 | 354 | } |
348 | 355 | if( $args ) { |
349 | 356 | $this->mArgs = $args; |
350 | | - $this->inputLoaded = true; |
| 357 | + $this->mInputLoaded = true; |
351 | 358 | } |
352 | 359 | |
353 | 360 | # If we've already loaded input (either by user values or from $argv) |
354 | 361 | # skip on loading it again. The array_shift() will corrupt values if |
355 | 362 | # it's run again and again |
356 | | - if( $this->inputLoaded ) { |
| 363 | + if( $this->mInputLoaded ) { |
357 | 364 | $this->loadSpecialVars(); |
358 | 365 | return; |
359 | 366 | } |
— | — | @@ -414,7 +421,7 @@ |
415 | 422 | $this->mOptions = $options; |
416 | 423 | $this->mArgs = $args; |
417 | 424 | $this->loadSpecialVars(); |
418 | | - $this->inputLoaded = true; |
| 425 | + $this->mInputLoaded = true; |
419 | 426 | } |
420 | 427 | |
421 | 428 | /** |
— | — | @@ -667,7 +674,98 @@ |
668 | 675 | |
669 | 676 | # Done |
670 | 677 | $dbw->commit(); |
| 678 | + } |
| 679 | + |
| 680 | + /** |
| 681 | + * Get the list of available maintenance scripts. Note |
| 682 | + * that if you call this _before_ calling doMaintenance |
| 683 | + * you won't have any extensions in it yet |
| 684 | + * @return array |
| 685 | + */ |
| 686 | + public static function getMaintenanceScripts() { |
| 687 | + global $wgMaintenanceScripts; |
| 688 | + return $wgMaintenanceScripts + self::getCoreScripts(); |
| 689 | + } |
671 | 690 | |
| 691 | + /** |
| 692 | + * Return all of the core maintenance scripts |
| 693 | + * @return array |
| 694 | + */ |
| 695 | + private static function getCoreScripts() { |
| 696 | + if( !self::$mCoreScripts ) { |
| 697 | + $d = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; |
| 698 | + self::$mCoreScripts = array( |
| 699 | + 'AttachLatest' => $d . 'attachLatest.php', |
| 700 | + 'BenchmarkPurge' => $d . 'benchmarkPurge.php', |
| 701 | + 'ChangePassword' => $d . 'changePassword.php', |
| 702 | + 'CheckAutoLoader' => $d . 'checkAutoLoader.php', |
| 703 | + 'CheckBadRedirects' => $d . 'checkBadRedirects.php', |
| 704 | + 'CheckImages' => $d . 'checkImages.php', |
| 705 | + 'CheckSyntax' => $d . 'checkSyntax.php', |
| 706 | + 'CheckUsernames' => $d . 'checkUsernames.php', |
| 707 | + 'CleanupSpam' => $d . 'cleanupSpam.php', |
| 708 | + 'ClearInterwikiCache' => $d . 'clear_interwiki_cache.php', |
| 709 | + 'clear_stats' => $d . 'clear_stats.php', |
| 710 | + 'ConvertLinks' => $d . 'convertLinks.php', |
| 711 | + 'ConvertUserOptions' => $d . 'convertUserOptions.php', |
| 712 | + 'CreateAndPromote' => $d . 'createAndPromote.php', |
| 713 | + 'DeleteArchivedFiles' => $d . 'deleteArchivedFiles.php', |
| 714 | + 'DeleteArchivedRevisions' => $d . 'deleteArchivedRevisions.php', |
| 715 | + 'DeleteBatch' => $d . 'deleteBatch.php', |
| 716 | + 'DeleteDefaultMessages' => $d . 'deleteDefaultMessages.php', |
| 717 | + 'DeleteImageCache' => $d . 'deleteImageMemcached.php', |
| 718 | + 'DeleteOldRevisions' => $d . 'deleteOldRevisions.php', |
| 719 | + 'DeleteOrphanedRevisions' => $d . 'deleteOrphanedRevisions.php', |
| 720 | + 'DeleteRevision' => $d . 'deleteRevision.php', |
| 721 | + 'DumpLinks' => $d . 'dumpLinks.php', |
| 722 | + 'DumpSisterSites' => $d . 'dumpSisterSites.php', |
| 723 | + 'UploadDumper' => $d . 'dumpUploads.php', |
| 724 | + 'EditCLI' => $d . 'edit.php', |
| 725 | + 'EvalPrompt' => $d . 'eval.php', |
| 726 | + 'FetchText' => $d . 'fetchText.php', |
| 727 | + 'FixUserRegistration' => $d . 'fixUserRegistration.php', |
| 728 | + 'GenerateSitemap' => $d . 'generateSitemap.php', |
| 729 | + 'GetLagTimes' => $d . 'getLagTimes.php', |
| 730 | + 'GetSlaveServer' => $d . 'getSlaveServer.php', |
| 731 | + 'InitEditCount' => $d . 'initEditCount.php', |
| 732 | + 'InitStats' => $d . 'initStats.php', |
| 733 | + 'mcTest' => $d . 'mctest.php', |
| 734 | + 'MoveBatch' => $d . 'moveBatch.php', |
| 735 | + 'nextJobDb' => $d . 'nextJobDB.php', |
| 736 | + 'NukeNS' => $d . 'nukeNS.php', |
| 737 | + 'NukePage' => $d . 'nukePage.php', |
| 738 | + 'Orphans' => $d . 'orphans.php', |
| 739 | + 'PopulateCategory' => $d . 'populateCategory.php', |
| 740 | + 'PopulateLogSearch' => $d . 'populateLogSearch.php', |
| 741 | + 'PopulateParentId' => $d . 'populateParentId.php', |
| 742 | + 'Protect' => $d . 'protect.php', |
| 743 | + 'PurgeList' => $d . 'purgeList.php', |
| 744 | + 'PurgeOldText' => $d . 'purgeOldText.php', |
| 745 | + 'ReassignEdits' => $d . 'reassignEdits.php', |
| 746 | + 'RebuildAll' => $d . 'rebuildall.php', |
| 747 | + 'RebuildFileCache' => $d . 'rebuildFileCache.php', |
| 748 | + 'RebuildLocalisationCache' => $d . 'rebuildLocalisationCache.php', |
| 749 | + 'RebuildMessages' => $d . 'rebuildmessages.php', |
| 750 | + 'RebuildRecentchanges' => $d . 'rebuildrecentchanges.php', |
| 751 | + 'RebuildTextIndex' => $d . 'rebuildtextindex.php', |
| 752 | + 'RefreshImageCount' => $d . 'refreshImageCount.php', |
| 753 | + 'RefreshLinks' => $d . 'refreshLinks.php', |
| 754 | + 'RemoveUnusedAccounts' => $d . 'removeUnusedAccounts.php', |
| 755 | + 'RenameDbPrefix' => $d . 'renameDbPrefix.php', |
| 756 | + 'DumpRenderer' => $d . 'renderDump.php', |
| 757 | + 'RunJobs' => $d . 'runJobs.php', |
| 758 | + 'ShowJobs' => $d . 'showJobs.php', |
| 759 | + 'ShowStats' => $d . 'showStats.php', |
| 760 | + 'MwSql' => $d . 'sql.php', |
| 761 | + 'CacheStats' => $d . 'stats.php', |
| 762 | + 'Undelete' => $d . 'undelete.php', |
| 763 | + 'UpdateArticleCount' => $d . 'updateArticleCount.php', |
| 764 | + 'UpdateRestrictions' => $d . 'updateRestrictions.php', |
| 765 | + 'UpdateSearchIndex' => $d . 'updateSearchIndex.php', |
| 766 | + 'UpdateSpecialPages' => $d . 'updateSpecialPages.php', |
| 767 | + 'WaitForSlave' => $d . 'waitForSlave.php', |
| 768 | + ); |
| 769 | + } |
| 770 | + return self::$mCoreScripts; |
672 | 771 | } |
673 | 772 | } |
674 | | - |
Index: branches/maintenance-work/maintenance/renameDbPrefix.php |
— | — | @@ -62,3 +62,6 @@ |
63 | 63 | $this->output( "Done! [$count tables]\n" ); |
64 | 64 | } |
65 | 65 | } |
| 66 | + |
| 67 | +$maintClass = "RenameDbPrefix"; |
| 68 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/maintenance/cleanupSpam.php |
— | — | @@ -111,3 +111,6 @@ |
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
| 115 | + |
| 116 | +$maintClass = "CleanupSpam"; |
| 117 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/maintenance/purgeList.php |
— | — | @@ -45,3 +45,5 @@ |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
| 49 | +$maintClass = "PurgeList"; |
| 50 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/maintenance/rebuildmessages.php |
— | — | @@ -31,4 +31,5 @@ |
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | | - |
| 35 | +$maintClass = "RebuildMessages"; |
| 36 | +require_once( DO_MAINTENANCE ); |
Index: branches/maintenance-work/includes/DefaultSettings.php |
— | — | @@ -3867,3 +3867,10 @@ |
3868 | 3868 | * modify the user rights of those users via Special:UserRights |
3869 | 3869 | */ |
3870 | 3870 | $wgUserrightsInterwikiDelimiter = '@'; |
| 3871 | + |
| 3872 | +/** |
| 3873 | + * Array for extensions to register their maintenance scripts with the |
| 3874 | + * system. The key is the name of the class and the value is the full |
| 3875 | + * path to the file |
| 3876 | + */ |
| 3877 | +$wgMaintenanceScripts = array(); |