User:😂/maintenance-work

Bug 19133 is a tracking bug to clean up the maintenance scripts (which are currently a gigantic mess). The maintenance-work branch was created to fix this.

Bugzilla
The following bugs will be marked FIXED when the maintenance-work branch is integrated to trunk:


 * 19133 - Maintenance script cleanup


 * 16322 - Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php
 * 18768 - Remove AdminSettings.php from MediaWiki core
 * 19157 - createAndPromote error on bad password
 * 18855 - require commandLine.inc properly (will be INVALID, commandLine.inc will be phased out)

Todo/Fixme

 * Handle param validation at Maintenance level, rather than making subclasses control this
 * Split WMF-specific scripts to an extension?
 * Make help work for -help, not just --help and help as an arg.

Outstanding questions
These are things that I still need Brion/Tim/somebody's input on, as I need info about how the WMF maintenance environment works
 * Am I right in understanding that $wgUseNormalUser means to use the normal Wiki DB user, rather than the super user? Could this safely be deprecated in favor of a more OOP approach?
 * Is $wgUseRootUser actually used anywhere?
 * Can the scripts in "to be deprecated" be safely deleted?

Scripts
The following scripts have been checked and sorted into the following lists. If a maintenance script is not here, it has not been reviewed.

WMF-specific

 * addwiki.php
 * dumpInterwiki.php
 * ourusers.php
 * rebuildInterwiki.php
 * renamewiki.php

Fully ported

 * benchmarkPurge.php

Fully ported && tested

 * attachLatest.php
 * eval.php
 * changePassword.php
 * checkAutoLoader.php
 * checkUsernames.php
 * clear_stats.php
 * createAndPromote.php
 * deleteRevision.php
 * getSlaveServer.php
 * nextJobDB.php
 * refreshImageCount.php
 * renameDbPrefix.php
 * showJobs.php
 * waitForSlave.php

To be deprecated

 * attribute.php (in favor of reassignEdits.php)
 * namespace2sql.php (doesn't seem to ever have been used)