Go to the documentation of this file.
31 require_once __DIR__ .
'/Maintenance.php';
41 parent::__construct();
42 $this->mDescription =
"Deletes a batch of pages";
43 $this->
addOption(
'u',
"User to perform deletion",
false,
true );
44 $this->
addOption(
'r',
"Reason to delete page",
false,
true );
45 $this->
addOption(
'i',
"Interval to sleep between deletions" );
46 $this->
addArg(
'listfile',
'File with titles to delete, separated by newlines. ' .
47 'If not given, stdin will be used.',
false );
53 # Change to current working directory
58 $username = $this->
getOption(
'u',
'Delete page script' );
64 $this->
error(
"Invalid username",
true );
76 $this->
error(
"Unable to read file, exiting",
true );
82 for ( $linenum = 1; !feof(
$file ); $linenum++ ) {
89 $this->
output(
"Invalid title '$line' on line $linenum\n" );
93 $this->
output(
"Skipping nonexistent page '$line'\n" );
98 $dbw->begin( __METHOD__ );
101 if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
102 $this->
output(
" FAILED to delete associated file... " );
108 $dbw->commit( __METHOD__ );
110 $this->
output(
" Deleted!\n" );
112 $this->
output(
" FAILED to delete article\n" );
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.
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?
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
__construct()
Default constructor.
Maintenance script to delete a batch of pages.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
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().
presenting them properly to the user as errors is done by the caller $title
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
getOption( $name, $default=null)
Get an option, or return the default.
addArg( $arg, $description, $required=true)
Add some args that are needed.
wfFindFile( $title, $options=array())
Find a file.
error( $err, $die=0)
Throw an error to the user.
output( $out, $channel=null)
Throw some output to the user.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string as detected by MediaWiki Handlers will typically only apply for specific mime types object & $error
getArg( $argId=0, $default=null)
Get an argument.