23 require_once __DIR__ .
'/Maintenance.php';
35 parent::__construct();
37 $this->
addOption(
'user',
'User name',
true,
true );
38 $this->
addOption(
'count',
'Number of edits',
true,
true );
39 $this->
addOption(
'namespace',
'Namespace number',
false,
true );
45 if ( !$user->isRegistered() ) {
50 $namespace = (int)$this->
getOption(
'namespace', 0 );
51 $services = MediaWikiServices::getInstance();
52 $wikiPageFactory = $services->getWikiPageFactory();
54 for ( $i = 0; $i < $count; ++$i ) {
56 $page = $wikiPageFactory->newFromTitle(
$title );
60 $page->doUserEditContent(
$content, $user, $summary );
62 $this->
output(
"Edited $title\n" );
73 require_once RUN_MAINTENANCE_IF_MAIN;
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
waitForReplication()
Wait for replica DBs to catch up.
getBatchSize()
Returns batch size.
addDescription( $text)
Set the description text.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
getOption( $name, $default=null)
Get an option, or return the default.
fatalError( $msg, $exitCode=1)
Output a message and terminate the current script.
Make test edits for a user to populate a test wiki.
execute()
Do the actual work.
__construct()
Default constructor.
static newFromName( $name, $validate='valid')