Go to the documentation of this file.
32 require_once __DIR__ .
'/cleanupTable.inc';
46 parent::__construct();
48 $this->
addOption(
'namespace',
'Namespace number to run caps cleanup on',
false,
true );
54 $this->
namespace = intval( $this->
getOption( 'namespace', 0 ) );
57 $this->
output(
"Will be moving pages to first letter capitalized titles" );
58 $callback =
'processRowToUppercase';
60 $this->
output(
"Will be moving pages to first letter lowercase titles" );
61 $callback =
'processRowToLowercase';
64 $this->dryrun = $this->
hasOption(
'dry-run' );
68 'conds' => [
'page_namespace' => $this->
namespace ],
70 'callback' => $callback ] );
77 $display = $current->getPrefixedText();
78 $lower = $row->page_title;
80 if ( $upper == $lower ) {
81 $this->
output(
"\"$display\" already uppercase.\n" );
87 if ( $target->exists() ) {
94 'Converting page title to first-letter uppercase',
99 if ( $row->page_namespace == $this->namespace ) {
100 $talk = $target->getTalkPage();
101 $row->page_namespace = $talk->getNamespace();
102 if ( $talk->exists() ) {
115 $display = $current->getPrefixedText();
116 $upper = $row->page_title;
118 if ( $upper == $lower ) {
119 $this->
output(
"\"$display\" already lowercase.\n" );
125 if ( $target->exists() ) {
126 $targetDisplay = $target->getPrefixedText();
127 $this->
output(
"\"$display\" skipped; \"$targetDisplay\" already exists\n" );
132 $ok = $this->
movePage( $current, $target,
'Converting page titles to lowercase',
true );
133 if ( $ok ===
true ) {
135 if ( $row->page_namespace == $this->namespace ) {
136 $talk = $target->getTalkPage();
137 $row->page_namespace = $talk->getNamespace();
138 if ( $talk->exists() ) {
158 if ( $this->dryrun ) {
159 $this->
output(
"\"$display\" -> \"$targetDisplay\": DRY RUN, NOT MOVED\n" );
162 $mp =
new MovePage( $current, $target );
163 $status = $mp->move( $this->
user, $reason, $createRedirect );
164 $ok =
$status->isOK() ?
'OK' :
$status->getWikiText(
false,
false,
'en' );
165 $this->
output(
"\"$display\" -> \"$targetDisplay\": $ok\n" );
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
processRowToUppercase( $row)
addDescription( $text)
Set the description text.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
getPrefixedText()
Get the prefixed title with spaces.
require_once RUN_MAINTENANCE_IF_MAIN
movePage(Title $current, Title $target, $reason, $createRedirect)
processRowToLowercase( $row)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static newSystemUser( $name, $options=[])
Static factory method for creation of a "system" user from username.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Handles the backend logic of moving a page from one title to another.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
execute()
Do the actual work.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
when a variable name is used in a it is silently declared as a new masking the global
Generic class to cleanup a database table.
Represents a title within MediaWiki.
getOption( $name, $default=null)
Get an option, or return the default.
static isCapitalized( $index)
Is the namespace first-letter capitalized?
output( $out, $channel=null)
Throw some output to the user.
hasOption( $name)
Checks to see if a particular param exists.
Maintenance script to clean up broken page links when somebody turns on or off $wgCapitalLinks.
__construct()
Default constructor.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang