protected $mQuiet = false;
protected $mDbUser, $mDbPass;
- // A description of the script, children should change this
+ // A description of the script, children should change this via addDescription()
protected $mDescription = '';
// Have we already loaded our user input?
$this->addOption( "fix", "Actually fix the entries, will dry run otherwise" );
$this->addOption( "regenerate-all",
"Regenerate the page_latest field for all records in table page" );
- $this->mDescription = "Fix page_latest entries in the page table";
+ $this->addDescription( 'Fix page_latest entries in the page table' );
}
public function execute() {
class BenchHttpHttps extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark HTTP request vs HTTPS request.";
+ $this->addDescription( 'Benchmark HTTP request vs HTTPS request.' );
}
public function execute() {
class BenchWikimediaBaseConvert extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark for Wikimedia\\base_convert.";
+ $this->addDescription( 'Benchmark for Wikimedia\base_convert.' );
$this->addOption( "inbase", "Input base", false, true );
$this->addOption( "outbase", "Output base", false, true );
$this->addOption( "length", "Size in digits to generate for input", false, true );
class BenchmarkDeleteTruncate extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmarks SQL DELETE vs SQL TRUNCATE.";
+ $this->addDescription( 'Benchmarks SQL DELETE vs SQL TRUNCATE.' );
}
public function execute() {
class BenchIfSwitch extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark if elseif... versus switch case.";
+ $this->addDescription( 'Benchmark if elseif... versus switch case.' );
}
public function execute() {
class BenchStrtrStrReplace extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark for strtr() vs str_replace().";
+ $this->addDescription( 'Benchmark for strtr() vs str_replace().' );
}
public function execute() {
$this->canRun = function_exists( 'mb_check_encoding' );
if ( $this->canRun ) {
- $this->mDescription = "Benchmark for using a regexp vs. mb_check_encoding " .
- "to check for UTF-8 encoding.";
- mb_internal_encoding( 'UTF-8' );
+ $this->addDescription( "Benchmark for using a regexp vs. mb_check_encoding " .
+ "to check for UTF-8 encoding." );
} else {
- $this->mDescription = "CANNOT RUN benchmark using mb_check_encoding: function not available.";
+ $this->addDescription( 'CANNOT RUN benchmark using mb_check_encoding: function not available.' );
}
}
class BenchWfIsWindows extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark for wfIsWindows.";
+ $this->addDescription( 'Benchmark for wfIsWindows.' );
}
public function execute() {
class BenchmarkHooks extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Benchmark MediaWiki Hooks.';
+ $this->addDescription( 'Benchmark MediaWiki Hooks.' );
}
public function execute() {
class BenchmarkPurge extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark the Squid purge functions.";
+ $this->addDescription( 'Benchmark the Squid purge functions.' );
}
public function execute() {
$this->addOption( "user", "The username to operate on", false, true );
$this->addOption( "userid", "The user id to operate on", false, true );
$this->addOption( "password", "The password to use", true, true );
- $this->mDescription = "Change a user's password";
+ $this->addDescription( "Change a user's password" );
}
public function execute() {
class CheckBadRedirects extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Check for bad redirects";
+ $this->addDescription( 'Check for bad redirects' );
}
public function execute() {
class CheckComposerLockUpToDate extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- 'Checks whether your composer.lock file is up to date with the current composer.json';
+ $this->addDescription(
+ 'Checks whether your composer.lock file is up to date with the current composer.json' );
}
public function execute() {
public function __construct() {
parent::__construct();
- $this->mDescription = "Check images to see if they exist, are readable, etc";
+ $this->addDescription( 'Check images to see if they exist, are readable, etc' );
$this->setBatchSize( 1000 );
}
public function __construct() {
parent::__construct();
- $this->mDescription =
- 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite';
+ $this->addDescription(
+ 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite' );
}
public function execute() {
public function __construct() {
parent::__construct();
- $this->mDescription = "Check syntax for all PHP files in MediaWiki";
+ $this->addDescription( 'Check syntax for all PHP files in MediaWiki' );
$this->addOption( 'with-extensions', 'Also recurse the extensions folder' );
$this->addOption(
'path',
public function __construct() {
parent::__construct();
- $this->mDescription = "Verify that database usernames are actually valid";
+ $this->addDescription( 'Verify that database usernames are actually valid' );
$this->setBatchSize( 1000 );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Cleanup ancient tables and indexes";
+ $this->addDescription( 'Cleanup ancient tables and indexes' );
$this->addOption( 'force', 'Actually run this script' );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Cleanup user blocks with user names not matching the 'user' table";
+ $this->addDescription( "Cleanup user blocks with user names not matching the 'user' table" );
$this->setBatchSize( 1000 );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to cleanup capitalization";
+ $this->addDescription( 'Script to cleanup capitalization' );
$this->addOption( 'namespace', 'Namespace number to run caps cleanup on', false, true );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to clean up broken, unparseable upload filenames";
+ $this->addDescription( 'Script to clean up broken, unparseable upload filenames' );
}
protected function processRow( $row ) {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database';
+ $this->addDescription(
+ 'Remove cache entries for removed ResourceLoader modules from the database' );
$this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Cleanup all spam from a given hostname";
+ $this->addDescription( 'Cleanup all spam from a given hostname' );
$this->addOption( 'all', 'Check all wikis in $wgLocalDatabases' );
$this->addOption( 'delete', 'Delete pages containing only spam instead of blanking them' );
$this->addArg(
class TitleCleanup extends TableCleanup {
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to clean up broken, unparseable titles";
+ $this->addDescription( 'Script to clean up broken, unparseable titles' );
}
/**
public function __construct() {
parent::__construct();
- $this->mDescription = "Clean up abandoned files in temporary uploaded file stash";
+ $this->addDescription( 'Clean up abandoned files in temporary uploaded file stash' );
$this->setBatchSize( 50 );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to remove broken, unparseable titles in the Watchlist";
+ $this->addDescription( 'Script to remove broken, unparseable titles in the Watchlist' );
$this->addOption( 'fix', 'Actually remove entries; without will only report.' );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Clear all interwiki links for all languages from the cache";
+ $this->addDescription( 'Clear all interwiki links for all languages from the cache' );
}
public function execute() {
class CompareParserCache extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Parse random pages and compare output to cache.";
+ $this->addDescription( 'Parse random pages and compare output to cache.' );
$this->addOption( 'namespace', 'Page namespace number', true, true );
$this->addOption( 'maxpages', 'Number of pages to try', true, true );
}
public function __construct() {
parent::__construct();
$this->saveFailed = false;
- $this->mDescription = "Run a file or dump with several parsers";
+ $this->addDescription( 'Run a file or dump with several parsers' );
$this->addOption( 'parser1', 'The first parser to compare.', true, true );
$this->addOption( 'parser2', 'The second parser to compare.', true, true );
$this->addOption( 'tidy', 'Run tidy on the articles.', false, false );
public function __construct() {
parent::__construct();
- $this->mDescription = 'Converts extension entry points to the new JSON registration format';
+ $this->addDescription( 'Converts extension entry points to the new JSON registration format' );
$this->addArg( 'path', 'Location to the PHP entry point you wish to convert',
/* $required = */ true );
$this->addOption( 'skin', 'Whether to write to skin.json', false, false );
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Convert from the old links schema (string->ID) to the new schema (ID->ID)."
- . "The wiki should be put into read-only mode while this script executes";
+ $this->addDescription(
+ 'Convert from the old links schema (string->ID) to the new schema (ID->ID). '
+ . 'The wiki should be put into read-only mode while this script executes' );
$this->addArg( 'logperformance', "Log performance to perfLogFilename.", false );
$this->addArg(
public function __construct() {
parent::__construct();
- $this->mDescription = "Convert user options from old to new system";
+ $this->addDescription( 'Convert user options from old to new system' );
$this->setBatchSize( 50 );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Copy files in one backend to another.";
+ $this->addDescription( 'Copy files in one backend to another.' );
$this->addOption( 'src', 'Backend containing the source files', true, true );
$this->addOption( 'dst', 'Backend where files should be copied to', true, true );
$this->addOption( 'containers', 'Pipe separated list of containers', true, true );
class CopyJobQueue extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Copy jobs from one queue system to another.";
+ $this->addDescription( 'Copy jobs from one queue system to another.' );
$this->addOption( 'src', 'Key to $wgJobQueueMigrationConfig for source', true, true );
$this->addOption( 'dst', 'Key to $wgJobQueueMigrationConfig for destination', true, true );
$this->addOption( 'type', 'Types of jobs to copy (use "all" for all)', true, true );
public function __construct() {
parent::__construct();
- $this->mDescription = "Create a new user account and/or grant it additional rights";
+ $this->addDescription( 'Create a new user account and/or grant it additional rights' );
$this->addOption(
'force',
'If acccount exists already, just grant it rights or change password.'
public function __construct() {
global $IP;
parent::__construct();
- $this->mDescription = "Generate CDB file of common passwords";
+ $this->addDescription( 'Generate CDB file of common passwords' );
$this->addOption( 'limit', "Max number of passwords to write", false, true, 'l' );
$this->addArg( 'inputfile', 'List of passwords (one per line) to use or - for stdin', true );
$this->addArg(
class DeleteArchivedFiles extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Deletes all archived images.";
+ $this->addDescription( 'Deletes all archived images.' );
$this->addOption( 'delete', 'Perform the deletion' );
$this->addOption( 'force', 'Force deletion of rows from filearchive' );
}
class DeleteArchivedRevisions extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Deletes all archived revisions\nThese revisions will no longer be restorable";
+ $this->addDescription(
+ "Deletes all archived revisions\nThese revisions will no longer be restorable" );
$this->addOption( 'delete', 'Performs the deletion' );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Deletes a batch of pages";
+ $this->addDescription( 'Deletes a batch of pages' );
$this->addOption( 'u', "User to perform deletion", false, true );
$this->addOption( 'r', "Reason to delete page", false, true );
$this->addOption( 'i', "Interval to sleep between deletions" );
class DeleteDefaultMessages extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Deletes all pages in the MediaWiki namespace" .
- " which were last edited by \"MediaWiki default\"";
+ $this->addDescription( 'Deletes all pages in the MediaWiki namespace' .
+ ' which were last edited by "MediaWiki default"' );
}
public function execute() {
class DeleteEqualMessages extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Deletes all pages in the MediaWiki namespace that are equal to '
- . 'the default message';
+ $this->addDescription( 'Deletes all pages in the MediaWiki namespace that are equal to '
+ . 'the default message' );
$this->addOption( 'delete', 'Actually delete the pages (default: dry run)' );
$this->addOption( 'delete-talk', 'Don\'t leave orphaned talk pages behind during deletion' );
$this->addOption( 'lang-code', 'Check for subpages of this language code (default: root '
class DeleteOldRevisions extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Delete old (non-current) revisions from the database";
+ $this->addDescription( 'Delete old (non-current) revisions from the database' );
$this->addOption( 'delete', 'Actually perform the deletion' );
$this->addOption( 'page_id', 'List of page ids to work on', false );
}
class DeleteOrphanedRevisions extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Maintenance script to delete revisions which refer to a nonexisting page";
+ $this->addDescription(
+ 'Maintenance script to delete revisions which refer to a nonexisting page' );
$this->addOption( 'report', 'Prints out a count of affected revisions but doesn\'t delete them' );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Delete one or more revisions by moving them to the archive table";
+ $this->addDescription( 'Delete one or more revisions by moving them to the archive table' );
}
public function execute() {
class DeleteSelfExternals extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Delete self-references to $wgServer from externallinks';
+ $this->addDescription( 'Delete self-references to $wgServer from externallinks' );
$this->mBatchSize = 1000;
}
function __construct( $args = null ) {
parent::__construct();
- $this->mDescription = <<<TEXT
+ $this->addDescription( <<<TEXT
This script dumps the wiki page or logging database into an
XML interchange wrapper format for export or backup.
WARNING: this is not a full database dump! It is merely for public export
of your wiki. For full backup, see our online help at:
https://www.mediawiki.org/wiki/Backup
-TEXT;
+TEXT
+ );
$this->stderr = fopen( "php://stderr", "wt" );
// Actions
$this->addOption( 'full', 'Dump all revisions of every page' );
public function __construct() {
parent::__construct();
- $this->mDescription = "Does something with a dump";
+ $this->addDescription( 'Does something with a dump' );
$this->addOption( 'file', 'File with text to run.', false, true );
$this->addOption( 'dump', 'XML dump to execute all revisions.', false, true );
$this->addOption( 'from', 'Article from XML dump to start from.', false, true );
public function __construct() {
parent::__construct();
- $this->mDescription = "Runs a regex in the revisions from a dump";
+ $this->addDescription( 'Runs a regex in the revisions from a dump' );
$this->addOption( 'regex', 'Searching regex', true, true );
}
class DumpLinks extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Quick demo hack to generate a plaintext link dump";
+ $this->addDescription( 'Quick demo hack to generate a plaintext link dump' );
}
public function execute() {
function __construct( $args = null ) {
parent::__construct();
- $this->mDescription = <<<TEXT
+ $this->addDescription( <<<TEXT
This script postprocesses XML dumps from dumpBackup.php to add
page text which was stubbed out (using --stub).
XML input is accepted on stdin.
XML output is sent to stdout; progress reports are sent to stderr.
-TEXT;
+TEXT
+ );
$this->stderr = fopen( "php://stderr", "wt" );
$this->addOption( 'stub', 'To load a compressed stub dump instead of stdin. ' .
class UploadDumper extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Generates list of uploaded files which can be fed to tar or similar.
-By default, outputs relative paths against the parent directory of \$wgUploadDirectory.";
+ $this->addDescription( 'Generates list of uploaded files which can be fed to tar or similar.
+By default, outputs relative paths against the parent directory of $wgUploadDirectory.' );
$this->addOption( 'base', 'Set base relative path instead of wiki include root', false, true );
$this->addOption( 'local', 'List all local files, used or not. No shared files included' );
$this->addOption( 'used', 'Skip local images that are not used' );
class EditCLI extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Edit an article from the command line, text is from stdin";
+ $this->addDescription( 'Edit an article from the command line, text is from stdin' );
$this->addOption( 'user', 'Username', false, true, 'u' );
$this->addOption( 'summary', 'Edit summary', false, true, 's' );
$this->addOption( 'minor', 'Minor edit', false, false, 'm' );
class EraseArchivedFile extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Erases traces of deleted files.";
+ $this->addDescription( 'Erases traces of deleted files.' );
$this->addOption( 'delete', 'Perform the deletion' );
$this->addOption( 'filename', 'File name', false, true );
$this->addOption( 'filekey', 'File storage key (with extension) or "*"', true, true );
class ExportSites extends Maintenance {
public function __construct() {
- $this->mDescription = 'Exports site definitions the sites table to XML file';
+ $this->addDescription( 'Exports site definitions the sites table to XML file' );
$this->addArg( 'file', 'A file to write the XML to (see docs/sitelist.txt). ' .
'Use "php://stdout" to write to stdout.', true
class FetchText extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Fetch the raw revision blob from an old_id.\n" .
+ $this->addDescription( "Fetch the raw revision blob from an old_id.\n" .
"NOTE: Export transformations are NOT applied. " .
- "This is left to backupTextPass.php";
+ "This is left to backupTextPass.php"
+ );
}
/**
class TestFileOpPerformance extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Test fileop performance";
+ $this->addDescription( 'Test fileop performance' );
$this->addOption( 'b1', 'Backend 1', true, true );
$this->addOption( 'b2', 'Backend 2', false, true );
$this->addOption( 'srcdir', 'File source directory', true, true );
class FindDeprecated extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Find deprecated interfaces';
+ $this->addDescription( 'Find deprecated interfaces' );
}
public function getFiles() {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Find hooks that are undocumented, missing, or just plain wrong';
+ $this->addDescription( 'Find hooks that are undocumented, missing, or just plain wrong' );
$this->addOption( 'online', 'Check against MediaWiki.org hook documentation' );
}
function __construct() {
parent::__construct();
- $this->mDescription = 'Find registered files with no corresponding file.';
+ $this->addDescription( 'Find registered files with no corresponding file.' );
$this->addOption( 'start', 'Start after this file name', false, true );
$this->addOption( 'mtimeafter', 'Only include files changed since this time', false, true );
$this->addOption( 'mtimebefore', 'Only includes files changed before this time', false, true );
function __construct() {
parent::__construct();
- $this->mDescription = "Find unregistered files in the 'public' repo zone.";
+ $this->addDescription( "Find unregistered files in the 'public' repo zone." );
$this->addOption( 'subdir',
'Only scan files in this subdirectory (e.g. "a/a0")', false, true );
$this->addOption( 'verbose', "Mention file paths checked" );
class FixDefaultJsonContentPages extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- 'Fix instances of JSON pages prior to them being the ContentHandler default';
+ $this->addDescription(
+ 'Fix instances of JSON pages prior to them being the ContentHandler default' );
$this->setBatchSize( 100 );
}
class FixDoubleRedirects extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to fix double redirects";
+ $this->addDescription( 'Script to fix double redirects' );
$this->addOption( 'async', 'Don\'t fix anything directly, just queue the jobs' );
$this->addOption( 'title', 'Fix only redirects pointing to this page', false, true );
$this->addOption( 'dry-run', 'Perform a dry run, fix nothing' );
class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Fixes any entries in the externallinks table containing protocol-relative URLs";
+ $this->addDescription(
+ 'Fixes any entries in the externallinks table containing protocol-relative URLs' );
}
protected function getUpdateKey() {
class FixTimestamps extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "";
+ $this->addDescription( '' );
$this->addArg( 'offset', '' );
$this->addArg( 'start', 'Starting timestamp' );
$this->addArg( 'end', 'Ending timestamp' );
class FixUserRegistration extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Fix the user_registration field";
+ $this->addDescription( 'Fix the user_registration field' );
$this->setBatchSize( 1000 );
}
class GenerateJsonI18n extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Build JSON messages files from a PHP messages file";
+ $this->addDescription( 'Build JSON messages files from a PHP messages file' );
$this->addArg( 'phpfile', 'PHP file defining a $messages array', false );
$this->addArg( 'jsondir', 'Directory to write JSON files to', false );
*/
public function __construct() {
parent::__construct();
- $this->mDescription = "Creates a sitemap for the site";
+ $this->addDescription( 'Creates a sitemap for the site' );
$this->addOption(
'fspath',
'The file system path to save to, e.g. /tmp/sitemap; defaults to current directory',
public function __construct() {
parent::__construct();
- $this->mDescription = "Get serialized MediaWiki site configuration";
+ $this->addDescription( 'Get serialized MediaWiki site configuration' );
$this->addOption( 'regex', 'regex to filter variables with', false, true );
$this->addOption( 'iregex', 'same as --regex but case insensitive', false, true );
$this->addOption( 'settings', 'Space-separated list of wg* variables', false, true );
class GetLagTimes extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Dump replication lag times";
+ $this->addDescription( 'Dump replication lag times' );
}
public function execute() {
public function __construct() {
parent::__construct();
$this->addOption( "group", "Query group to check specifically" );
- $this->mDescription = "Report the hostname of a slave server";
+ $this->addDescription( 'Report the hostname of a slave server' );
}
public function execute() {
class GetTextMaint extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Outputs page text to stdout';
+ $this->addDescription( 'Outputs page text to stdout' );
$this->addOption( 'show-private', 'Show the text even if it\'s not available to the public' );
$this->addArg( 'title', 'Page title' );
}
? 'ok'
: '(disabled; requires PHP bzip2 module)';
- $this->mDescription = <<<TEXT
+ $this->addDescription(
+ <<<TEXT
This script reads pages from an XML file as produced from Special:Export or
dumpBackup.php, and saves them into the current wiki.
Note that for very large data sets, importDump.php may be slow; there are
alternate methods which can be much faster for full site restoration:
<https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps>
-TEXT;
+TEXT
+ );
$this->stderr = fopen( "php://stderr", "wt" );
$this->addOption( 'report',
'Report position and speed after every n pages processed', false, true );
class ImportSiteScripts extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Import site scripts from a site';
+ $this->addDescription( 'Import site scripts from a site' );
$this->addArg( 'api', 'API base url' );
$this->addArg( 'index', 'index.php base url' );
$this->addOption( 'username', 'User name of the script importer' );
class ImportSites extends Maintenance {
public function __construct() {
- $this->mDescription = 'Imports site definitions from XML into the sites table.';
+ $this->addDescription( 'Imports site definitions from XML into the sites table.' );
$this->addArg( 'file', 'An XML file containing site definitions (see docs/sitelist.txt). ' .
'Use "php://stdin" to read from stdin.', true
class ImportTextFiles extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Reads in text files and imports their content to pages of the wiki";
+ $this->addDescription( 'Reads in text files and imports their content to pages of the wiki' );
$this->addOption( 'user', 'Username to which edits should be attributed. ' .
'Default: "Maintenance script"', false, true, 'u' );
$this->addOption( 'summary', 'Specify edit summary for the edits', false, true, 's' );
Background mode will be automatically used if the server is MySQL 4.0
(which does not support subqueries) or if multiple servers are listed
in the load balancer, usually indicating a replication environment.' );
- $this->mDescription = "Batch-recalculate user_editcount fields from the revision table";
+ $this->addDescription( 'Batch-recalculate user_editcount fields from the revision table' );
}
public function execute() {
class InitSiteStats extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Re-initialise the site statistics tables";
+ $this->addDescription( 'Re-initialise the site statistics tables' );
$this->addOption( 'update', 'Update the existing statistics' );
$this->addOption( 'active', 'Also update active users count' );
$this->addOption( 'use-master', 'Count using the master database' );
public function __construct() {
parent::__construct();
- $this->mDescription = "Runs parsing/syntax checks on JavaScript files";
+ $this->addDescription( 'Runs parsing/syntax checks on JavaScript files' );
$this->addArg( 'file(s)', 'JavaScript file to test', false );
}
class DatabaseLag extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Shows database lag";
+ $this->addDescription( 'Shows database lag' );
$this->addOption( 'r', "Don't exit immediately, but show the lag every 5 seconds" );
}
class AllTrans extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Get all messages as defined by the English language file";
+ $this->addDescription( 'Get all messages as defined by the English language file' );
}
public function execute() {
public function __construct() {
parent::__construct();
- $this->mDescription = "Test various language time and date functions";
+ $this->addDescription( 'Test various language time and date functions' );
}
public function execute() {
public function __construct() {
parent::__construct();
- $this->mDescription = "Check digit transformation";
+ $this->addDescription( 'Check digit transformation' );
}
public function execute() {
class DumpMessages extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Dump an entire language, using the keys from English";
+ $this->addDescription( 'Dump an entire language, using the keys from English' );
}
public function execute() {
class GenerateNormalizerDataAr extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Generate the normalizer data file for Arabic';
+ $this->addDescription( 'Generate the normalizer data file for Arabic' );
$this->addOption( 'unicode-data-file', 'The local location of the data file ' .
'from http://unicode.org/Public/UNIDATA/UnicodeData.txt', false, true );
}
class GenerateNormalizerDataMl extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Generate the normalizer data file for Malayalam';
+ $this->addDescription( 'Generate the normalizer data file for Malayalam' );
}
public function getDbType() {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Generate Utf8Case.ser from the Unicode Character Database ' .
- 'and supplementary files';
+ $this->addDescription( 'Generate Utf8Case.ser from the Unicode Character Database ' .
+ 'and supplementary files' );
$this->addOption( 'unicode-data-file', 'The local location of the data file ' .
'from http://unicode.org/Public/UNIDATA/UnicodeData.txt', false, true );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Dumb program that tries to get the memory usage\n" .
- "for each language file";
+ $this->addDescription( "Dumb program that tries to get the memory usage\n" .
+ "for each language file" );
}
public function execute() {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Outputs a list of language variants';
+ $this->addDescription( 'Outputs a list of language variants' );
$this->addOption( 'flat', 'Output variants in a flat list' );
$this->addOption( 'json', 'Output variants as JSON' );
}
class MakeTestEdits extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Make test edits for a user";
+ $this->addDescription( 'Make test edits for a user' );
$this->addOption( 'user', 'User name', true, true );
$this->addOption( 'count', 'Number of edits', true, true );
$this->addOption( 'namespace', 'Namespace number', false, true );
class McTest extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Makes several 'set', 'incr' and 'get' requests on every"
- . " memcached server and shows a report";
+ $this->addDescription( "Makes several 'set', 'incr' and 'get' requests on every"
+ . " memcached server and shows a report" );
$this->addOption( 'i', 'Number of iterations', false, true );
$this->addOption( 'cache', 'Use servers from this $wgObjectCaches store', false, true );
$this->addArg( 'server[:port]', 'Memcached server to test, with optional port', false );
);
$this->addOption( 'extensions-dir', 'Path where extensions can be found.', false, true );
$this->addOption( 'output', 'Send output to this file (omit for stdout)', false, true );
- $this->mDescription = 'Merge $wgExtensionMessagesFiles and $wgMessagesDirs from ' .
- ' various extensions to produce a single file listing all message files and dirs.';
+ $this->addDescription( 'Merge $wgExtensionMessagesFiles and $wgMessagesDirs from ' .
+ ' various extensions to produce a single file listing all message files and dirs.'
+ );
}
public function execute() {
class MigrateFileRepoLayout extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Copy files in repo to a different layout.";
+ $this->addDescription( 'Copy files in repo to a different layout.' );
$this->addOption( 'oldlayout', "Old layout; one of 'name' or 'sha1'", true, true );
$this->addOption( 'newlayout', "New layout; one of 'name' or 'sha1'", true, true );
$this->addOption( 'since', "Copy only files from after this timestamp", false, true );
class MigrateUserGroup extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Re-assign users from an old group to a new one";
+ $this->addDescription( 'Re-assign users from an old group to a new one' );
$this->addArg( 'oldgroup', 'Old user group key', true );
$this->addArg( 'newgroup', 'New user group key', true );
$this->setBatchSize( 200 );
"Directory for output. If this is not specified, and neither is --outfile, then the\n" .
"output files will be sent to the same directories as the input files.",
false, true );
- $this->mDescription = "Minify a file or set of files.\n\n" .
+ $this->addDescription( "Minify a file or set of files.\n\n" .
"If --outfile is not specified, then the output file names will have a .min extension\n" .
- "added, e.g. jquery.js -> jquery.min.js.";
+ "added, e.g. jquery.js -> jquery.min.js."
+ );
}
public function execute() {
class MoveBatch extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Moves a batch of pages";
+ $this->addDescription( 'Moves a batch of pages' );
$this->addOption( 'u', "User to perform move", false, true );
$this->addOption( 'r', "Reason to move page", false, true );
$this->addOption( 'i', "Interval to sleep between moves" );
*/
public function __construct() {
parent::__construct();
- $this->mDescription = 'Build doxygen documentation';
+ $this->addDescription( 'Build doxygen documentation' );
$this->addOption( 'doxygen',
'Path to doxygen',
public function __construct() {
parent::__construct();
- $this->mDescription = "";
+ $this->addDescription( 'Find and fix pages affected by namespace addition/removal' );
$this->addOption( 'fix', 'Attempt to automatically fix errors' );
$this->addOption( 'merge', "Instead of renaming conflicts, do a history merge with " .
"the correct title" );
class NukeNS extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Remove pages with only 1 revision from any namespace";
+ $this->addDescription( 'Remove pages with only 1 revision from any namespace' );
$this->addOption( 'delete', "Actually delete the page" );
$this->addOption( 'ns', 'Namespace to delete from, default NS_MEDIAWIKI', false, true );
$this->addOption( 'all', 'Delete everything regardless of revision count' );
class NukePage extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Remove a page record from the database";
+ $this->addDescription( 'Remove a page record from the database' );
$this->addOption( 'delete', "Actually delete the page" );
$this->addArg( 'title', 'Title to delete' );
}
class AlterSharedConstraints extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Alter foreign key to reference master tables in shared database setup.";
+ $this->addDescription( 'Alter foreign key to reference master tables in shared database setup.' );
}
public function getDbType() {
class Orphans extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Look for 'orphan' revisions hooked to pages which don't exist\n" .
+ $this->addDescription( "Look for 'orphan' revisions hooked to pages which don't exist\n" .
"and 'childless' pages with no revisions\n" .
"Then, kill the poor widows and orphans\n" .
- "Man this is depressing";
+ "Man this is depressing"
+ );
$this->addOption( 'fix', 'Actually fix broken entries' );
}
class PageExists extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Report whether a specific page exists";
+ $this->addDescription( 'Report whether a specific page exists' );
$this->addArg( 'title', 'Page title to check whether it exists' );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Parse a given wikitext";
+ $this->addDescription( 'Parse a given wikitext' );
$this->addOption(
'title',
'Title name for the given wikitext (Default: \'CLIParser\')',
class PatchSql extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Run an SQL file into the DB, replacing prefix and charset vars";
+ $this->addDescription( 'Run an SQL file into the DB, replacing prefix and charset vars' );
$this->addArg(
'patch-name',
'Name of the patch file, either full path or in maintenance/archives'
class PopulateBacklinkNamespace extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populate the *_from_namespace fields";
+ $this->addDescription( 'Populate the *_from_namespace fields' );
$this->addOption( 'lastUpdatedId', "Highest page_id with updated links", false, true );
}
public function __construct() {
parent::__construct();
- $this->mDescription = <<<TEXT
+ $this->addDescription(
+ <<<TEXT
This script will populate the category table, added in MediaWiki 1.13. It will
print out progress indicators every 1000 categories it adds to the table. The
script is perfectly safe to run on large, live wikis, and running it multiple
When the script has finished, it will make a note of this in the database, and
will not run again without the --force option.
-TEXT;
-# '
+TEXT
+ );
+
$this->addOption(
'begin',
'Only do categories whose names are alphabetically after the provided name',
class PopulateContentModel extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Populate the various content_* fields';
+ $this->addDescription( 'Populate the various content_* fields' );
$this->addOption( 'ns', 'Namespace to run in, or "all" for all namespaces', true, true );
$this->addOption( 'table', 'Table to run in', true, true );
$this->setBatchSize( 100 );
class PopulateFilearchiveSha1 extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populate the fa_sha1 field from fa_storage_key";
+ $this->addDescription( 'Populate the fa_sha1 field from fa_storage_key' );
}
protected function getUpdateKey() {
class PopulateImageSha1 extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populate the img_sha1 field";
+ $this->addDescription( 'Populate the img_sha1 field' );
$this->addOption( 'force', "Recalculate sha1 for rows that already have a value" );
$this->addOption( 'multiversiononly', "Calculate only for files with several versions" );
$this->addOption( 'method', "Use 'pipe' to pipe to mysql command line,\n" .
public function __construct() {
parent::__construct();
- $this->mDescription = "Migrate log params to new table and index for searching";
+ $this->addDescription( 'Migrate log params to new table and index for searching' );
$this->setBatchSize( 100 );
}
class PopulateLogUsertext extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populates the log_user_text field";
+ $this->addDescription( 'Populates the log_user_text field' );
$this->setBatchSize( 100 );
}
class PopulateParentId extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populates rev_parent_id";
+ $this->addDescription( 'Populates rev_parent_id' );
}
protected function getUpdateKey() {
class PopulateRecentChangesSource extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Populates rc_source field of the recentchanges table with the data in rc_type.";
+ $this->addDescription(
+ 'Populates rc_source field of the recentchanges table with the data in rc_type.' );
$this->setBatchSize( 100 );
}
class PopulateRevisionLength extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populates the rev_len and ar_len fields";
+ $this->addDescription( 'Populates the rev_len and ar_len fields' );
$this->setBatchSize( 200 );
}
class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Populates the rev_sha1 and ar_sha1 fields";
+ $this->addDescription( 'Populates the rev_sha1 and ar_sha1 fields' );
$this->setBatchSize( 200 );
}
class Protect extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Protect or unprotect a page from the command line.";
+ $this->addDescription( 'Protect or unprotect a page from the command line.' );
$this->addOption( 'unprotect', 'Removes protection' );
$this->addOption( 'semiprotect', 'Adds semi-protection' );
$this->addOption( 'cascade', 'Add cascading protection' );
public function __construct() {
parent::__construct();
- $this->mDescription = "Build file cache for content pages";
+ $this->addDescription( 'Build file cache for content pages' );
$this->addOption( 'agedays', 'How many days old files must be in order to delete', true, true );
$this->addOption( 'subdir', 'Prune one $wgFileCacheDirectory subdirectory name', false, true );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Scan the logging table and purge files and thumbnails.";
+ $this->addDescription( 'Scan the logging table and purge files and thumbnails.' );
$this->addOption( 'starttime', 'Starting timestamp', true, true );
$this->addOption( 'endtime', 'Ending timestamp', true, true );
$this->addOption( 'type', 'Comma-separated list of types of changes to send purges for (' .
public function __construct() {
parent::__construct();
- $this->mDescription = 'Send purge requests for edits in date range to squid/varnish';
+ $this->addDescription( 'Send purge requests for edits in date range to squid/varnish' );
$this->addOption( 'starttime', 'Starting timestamp', true, true );
$this->addOption( 'endtime', 'Ending timestamp', true, true );
$this->addOption( 'htcp-dest', 'HTCP announcement destination (IP:port)', false, true );
class PurgeList extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Send purge requests for listed pages to squid";
+ $this->addDescription( 'Send purge requests for listed pages to squid' );
$this->addOption( 'purge', 'Whether to update page_touched.', false, false );
$this->addOption( 'namespace', 'Namespace number', false, true );
$this->addOption( 'all', 'Purge all pages', false, false );
class PurgeOldText extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Purge old text records from the database";
+ $this->addDescription( 'Purge old text records from the database' );
$this->addOption( 'purge', 'Performs the deletion' );
}
class ReassignEdits extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Reassign edits from one user to another";
+ $this->addDescription( 'Reassign edits from one user to another' );
$this->addOption( "force", "Reassign even if the target user doesn't exist" );
$this->addOption( "norc", "Don't update the recent changes table" );
$this->addOption( "report", "Print out details of what would be changed, but don't update it" );
class RebuildFileCache extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Build file cache for content pages";
+ $this->addDescription( 'Build file cache for content pages' );
$this->addOption( 'start', 'Page_id to start from', false, true );
$this->addOption( 'end', 'Page_id to end on', false, true );
$this->addOption( 'overwrite', 'Refresh page cache' );
// make sure to update old, but compatible img_metadata fields.
$wgUpdateCompatibleMetadata = true;
- $this->mDescription = 'Script to update image metadata records';
+ $this->addDescription( 'Script to update image metadata records' );
$this->addOption( 'missing', 'Check for files without associated database record' );
$this->addOption( 'dry-run', 'Only report, don\'t update the database' );
class RebuildLocalisationCache extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Rebuild the localisation cache";
+ $this->addDescription( 'Rebuild the localisation cache' );
$this->addOption( 'force', 'Rebuild all files, even ones not out of date' );
$this->addOption( 'threads', 'Fork more than one thread', false, true );
$this->addOption( 'outdir', 'Override the output directory (normally $wgCacheDirectory)',
public function __construct() {
parent::__construct();
- $this->mDescription = "Cache sites as json for file-based lookup.";
+ $this->addDescription( 'Cache sites as json for file-based lookup.' );
$this->addOption( 'file', 'File to output the json to', false, true );
}
class RebuildAll extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Rebuild links, text index and recent changes";
+ $this->addDescription( 'Rebuild links, text index and recent changes' );
}
public function getDbType() {
class RebuildMessages extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Purge all language messages from the cache";
+ $this->addDescription( 'Purge all language messages from the cache' );
}
public function execute() {
class RebuildRecentchanges extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Rebuild recent changes";
+ $this->addDescription( 'Rebuild recent changes' );
}
public function execute() {
public function __construct() {
parent::__construct();
- $this->mDescription = "Rebuild search index table from scratch";
+ $this->addDescription( 'Rebuild search index table from scratch' );
}
public function getDbType() {
class RefreshFileHeaders extends Maintenance {
function __construct() {
parent::__construct();
- $this->mDescription = 'Script to update file HTTP headers';
+ $this->addDescription( 'Script to update file HTTP headers' );
$this->addOption( 'verbose', 'Output information about each file.', false, false, 'v' );
$this->addOption( 'start', 'Name of file to start with', false, true );
$this->addOption( 'end', 'Name of file to end with', false, true );
function __construct() {
parent::__construct();
- $this->mDescription = 'Script to update image metadata records';
+ $this->addDescription( 'Script to update image metadata records' );
$this->setBatchSize( 200 );
$this->addOption(
class RefreshLinks extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Refresh link tables";
+ $this->addDescription( 'Refresh link tables' );
$this->addOption( 'dfn-only', 'Delete links from nonexistent articles only' );
$this->addOption( 'new-only', 'Only affect articles with just a single edit' );
$this->addOption( 'redirects-only', 'Only fix redirects, not all links' );
public function __construct() {
parent::__construct();
- $this->mDescription = "Take page text out of an XML dump file and render basic HTML out to files";
+ $this->addDescription(
+ 'Take page text out of an XML dump file and render basic HTML out to files' );
$this->addOption( 'output-dir', 'The directory to output the HTML files to', true, true );
$this->addOption( 'prefix', 'Prefix for the rendered files (defaults to wiki)', false, true );
$this->addOption( 'parser', 'Use an alternative parser class', false, true );
class ResetUserTokens extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Reset the user_token of all users on the wiki. Note that this may log some of them out.";
+ $this->addDescription(
+ 'Reset the user_token of all users on the wiki. Note that this may log some of them out.'
+ );
$this->addOption( 'nowarn', "Hides the 5 seconds warning", false, false );
$this->addOption(
'nulls',
class RollbackEdits extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Rollback all edits by a given user or IP provided they're the most recent edit";
+ $this->addDescription(
+ "Rollback all edits by a given user or IP provided they're the most recent edit" );
$this->addOption(
'titles',
'A list of titles, none means all titles where the given user is the most recent',
class BatchedQueryRunner extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
+ $this->addDescription(
"Run a query repeatedly until it affects 0 rows, and wait for slaves in between.\n" .
- "NOTE: You need to set a LIMIT clause yourself.";
+ "NOTE: You need to set a LIMIT clause yourself." );
}
public function execute() {
class RunJobs extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Run pending jobs";
+ $this->addDescription( 'Run pending jobs' );
$this->addOption( 'maxjobs', 'Maximum number of jobs to run', false, true );
$this->addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true );
$this->addOption( 'type', 'Type of job to run', false, true );
public function __construct() {
parent::__construct();
- $this->mDescription = "Show number of jobs waiting in master database";
+ $this->addDescription( 'Show number of jobs waiting in master database' );
$this->addOption( 'group', 'Show number of jobs per job type' );
$this->addOption( 'list', 'Show a list of all jobs instead of counts' );
$this->addOption( 'type', 'Only show/count jobs of a given type', false, true );
class ShowSiteStats extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Show the cached statistics";
+ $this->addDescription( 'Show the cached statistics' );
}
public function execute() {
class MwSql extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Send SQL queries to a MediaWiki database. " .
- "Takes a file name containing SQL as argument or runs interactively.";
+ $this->addDescription( 'Send SQL queries to a MediaWiki database. ' .
+ 'Takes a file name containing SQL as argument or runs interactively.' );
$this->addOption( 'query', 'Run a single query instead of running interactively', false, true );
$this->addOption( 'cluster', 'Use an external cluster by name', false, true );
$this->addOption( 'wikidb', 'The database wiki ID to use if not the current one', false, true );
class SqliteMaintenance extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Performs some operations specific to SQLite database backend";
+ $this->addDescription( 'Performs some operations specific to SQLite database backend' );
$this->addOption(
'vacuum',
'Clean up database by removing deleted pages. Decreases database file size'
public function __construct() {
parent::__construct();
- $this->mDescription = 'Compress the text of a wiki';
+ $this->addDescription( 'Compress the text of a wiki' );
$this->addOption( 'type', 'Set compression type to either: gzip|concat', false, true, 't' );
$this->addOption(
'chunksize',
function __construct() {
parent::__construct();
- $this->mDescription = 'Script to fix bug 20757 assuming that blob_tracking is intact';
+ $this->addDescription( 'Script to fix bug 20757 assuming that blob_tracking is intact' );
$this->addOption( 'dry-run', 'Report only' );
$this->addOption( 'start', 'old_id to start at', false, true );
}
class OrphanStats extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription =
- "Show some statistics on the blob_orphans table, created with trackBlobs.php";
+ $this->addDescription(
+ "Show some statistics on the blob_orphans table, created with trackBlobs.php" );
}
protected function &getDB( $cluster, $groups = array(), $wiki = false ) {
class SyncFileBackend extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Sync one file backend with another using the journal";
+ $this->addDescription( 'Sync one file backend with another using the journal' );
$this->addOption( 'src', 'Name of backend to sync from', true, true );
$this->addOption( 'dst', 'Name of destination backend to sync', false, true );
$this->addOption( 'start', 'Starting journal ID', false, true );
class Undelete extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Undelete a page";
+ $this->addDescription( 'Undelete a page' );
$this->addOption( 'user', 'The user to perform the undeletion', false, true, 'u' );
$this->addOption( 'reason', 'The reason to undelete', false, true, 'r' );
$this->addArg( 'pagename', 'Page to undelete' );
class UpdateMediaWiki extends Maintenance {
function __construct() {
parent::__construct();
- $this->mDescription = "MediaWiki database updater";
+ $this->addDescription( 'MediaWiki database updater' );
$this->addOption( 'skip-compat-checks', 'Skips compatibility checks, mostly for developers' );
$this->addOption( 'quick', 'Skip 5 second countdown before starting' );
$this->addOption( 'doshared', 'Also update shared tables' );
public function __construct() {
parent::__construct();
- $this->mDescription = "Count of the number of articles and update the site statistics table";
+ $this->addDescription( 'Count of the number of articles and update the site statistics table' );
$this->addOption( 'update', 'Update the site_stats table with the new count' );
$this->addOption( 'use-master', 'Count using the master database' );
}
parent::__construct();
global $wgCategoryCollation;
- $this->mDescription = <<<TEXT
+ $this->addDescription( <<<TEXT
This script will find all rows in the categorylinks table whose collation is
out-of-date (cl_collation != '$wgCategoryCollation') and repopulate cl_sortkey
using the page title and cl_sortkey_prefix. If all collations are
up-to-date, it will do nothing.
-TEXT;
+TEXT
+ );
$this->addOption( 'force', 'Run on all rows, even if the collation is ' .
'supposed to be up-to-date.' );
public function __construct() {
parent::__construct();
- $this->mDescription = "Script to normalize double-byte latin UTF-8 characters";
+ $this->addDescription( 'Script to normalize double-byte latin UTF-8 characters' );
$this->addOption( 'q', 'quiet', false, true );
$this->addOption(
'l',
class UpdateRestrictions extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Updates page_restrictions table from old page_restriction column";
+ $this->addDescription( 'Updates page_restrictions table from old page_restriction column' );
$this->setBatchSize( 100 );
}
public function __construct() {
parent::__construct();
- $this->mDescription = "Script for periodic off-peak updating of the search index";
+ $this->setDescription( 'Script for periodic off-peak updating of the search index' );
$this->addOption( 's', 'starting timestamp', false, true );
$this->addOption( 'e', 'Ending timestamp', false, true );
$this->addOption(
class WrapOldPasswords extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Wrap all passwords of a certain type in a new layered type";
+ $this->addDescription( 'Wrap all passwords of a certain type in a new layered type' );
$this->addOption( 'type',
'Password type to wrap passwords in (must inherit LayeredParameterizedPassword)', true, true );
$this->addOption( 'verbose', 'Enables verbose output', false, false, 'v' );