Go to the documentation of this file.
38 require_once __DIR__ .
'/Maintenance.php';
47 parent::__construct();
48 $this->mDescription =
"Moves a batch of pages";
49 $this->
addOption(
'u',
"User to perform move",
false,
true );
50 $this->
addOption(
'r',
"Reason to move page",
false,
true );
51 $this->
addOption(
'i',
"Interval to sleep between moves" );
52 $this->
addOption(
'noredirects',
"Suppress creation of redirects" );
53 $this->
addArg(
'listfile',
'List of pages to move, newline delimited',
false );
59 # Change to current working directory
67 $noredirects = $this->
getOption(
'noredirects',
false );
76 $this->
error(
"Unable to read file, exiting",
true );
80 $this->
error(
"Invalid username",
true );
83 # Setup complete, now start
85 for ( $linenum = 1; !feof(
$file ); $linenum++ ) {
87 if (
$line ===
false ) {
90 $parts = array_map(
'trim', explode(
'|',
$line ) );
91 if ( count( $parts ) != 2 ) {
92 $this->
error(
"Error on line $linenum, no pipe character" );
97 if ( is_null(
$source ) || is_null( $dest ) ) {
98 $this->
error(
"Invalid title on line $linenum" );
102 $this->
output(
$source->getPrefixedText() .
' --> ' . $dest->getPrefixedText() );
103 $dbw->begin( __METHOD__ );
104 $err =
$source->moveTo( $dest,
false, $reason, !$noredirects );
105 if ( $err !==
true ) {
106 $msg = array_shift( $err[0] );
109 $dbw->commit( __METHOD__ );
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getStdin( $len=null)
Return input from stdin.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
addOption( $name, $description, $required=false, $withArg=false, $shortName=false)
Add a parameter to the script.
require_once RUN_MAINTENANCE_IF_MAIN
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
hasArg( $argId=0)
Does a given argument exist?
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Maintenance script to move a batch of pages.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
when a variable name is used in a it is silently declared as a new masking the global
wfWaitForSlaves( $maxLag=false, $wiki=false, $cluster=false)
Modern version of wfWaitForSlaves().
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
if(PHP_SAPI !='cli') $file
__construct()
Default constructor.
getOption( $name, $default=null)
Get an option, or return the default.
execute()
Do the actual work.
addArg( $arg, $description, $required=true)
Add some args that are needed.
if(PHP_SAPI !='cli') $source
error( $err, $die=0)
Throw an error to the user.
output( $out, $channel=null)
Throw some output to the user.
getArg( $argId=0, $default=null)
Get an argument.