Go to the documentation of this file.
32 require_once __DIR__ .
'/cleanupTable.inc';
41 parent::__construct();
42 $this->mDescription =
"Script to clean up broken, unparseable titles";
56 &&
$title->getNamespace() == $row->page_namespace
57 &&
$title->getDBkey() === $row->page_title
64 if ( $row->page_namespace ==
NS_FILE && $this->fileExists( $row->page_title ) ) {
65 $this->
output(
"file $row->page_title needs cleanup, please run cleanupImages.php.\n" );
67 } elseif ( is_null(
$title ) ) {
68 $this->
output(
"page $row->page_id ($display) is illegal.\n" );
72 $this->
output(
"page $row->page_id ($display) doesn't match self.\n" );
86 $row =
$dbr->selectRow(
'image',
array(
'img_name' ),
array(
'img_name' =>
$name ), __METHOD__ );
88 return $row !==
false;
95 $legal =
'A-Za-z0-9_/\\\\-';
96 $legalized = preg_replace_callback(
"!([^$legal])!",
97 array( &$this,
'hexChar' ),
99 if ( $legalized ==
'.' ) {
100 $legalized =
'(dot)';
102 if ( $legalized ==
'_' ) {
103 $legalized =
'(space)';
105 $legalized =
'Broken/' . $legalized;
108 if ( is_null(
$title ) ) {
109 $clean =
'Broken/id:' . $row->page_id;
110 $this->
output(
"Couldn't legalize; form '$legalized' still invalid; using '$clean'\n" );
112 } elseif (
$title->exists() ) {
113 $clean =
'Broken/id:' . $row->page_id;
114 $this->
output(
"Legalized for '$legalized' exists; using '$clean'\n" );
118 $dest =
$title->getDBkey();
119 if ( $this->dryrun ) {
120 $this->
output(
"DRY RUN: would rename $row->page_id ($row->page_namespace," .
121 "'$row->page_title') to ($row->page_namespace,'$dest')\n" );
123 $this->
output(
"renaming $row->page_id ($row->page_namespace," .
124 "'$row->page_title') to ($row->page_namespace,'$dest')\n" );
126 $dbw->update(
'page',
127 array(
'page_title' => $dest ),
128 array(
'page_id' => $row->page_id ),
140 $prior =
$title->getPrefixedDBkey();
142 $prior =
$title->getDBkey();
145 # Old cleanupTitles could move articles there. See bug 23147.
146 $ns = $row->page_namespace;
151 # Namespace which no longer exists. Put the page in the main namespace
152 # since we don't have any idea of the old namespace name. See bug 68501.
157 $clean =
'Broken/' . $prior;
159 if ( $verified->exists() ) {
160 $blah =
"Broken/id:" . $row->page_id;
161 $this->
output(
"Couldn't legalize; form '$clean' exists; using '$blah'\n" );
166 if ( is_null(
$title ) ) {
167 $this->
error(
"Something awry; empty title.",
true );
169 $ns =
$title->getNamespace();
170 $dest =
$title->getDBkey();
172 if ( $this->dryrun ) {
173 $this->
output(
"DRY RUN: would rename $row->page_id ($row->page_namespace," .
174 "'$row->page_title') to ($ns,'$dest')\n" );
176 $this->
output(
"renaming $row->page_id ($row->page_namespace," .
177 "'$row->page_title') to ($ns,'$dest')\n" );
179 $dbw->update(
'page',
181 'page_namespace' => $ns,
182 'page_title' => $dest
184 array(
'page_id' => $row->page_id ),
__construct()
Default constructor.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Maintenance script to clean up broken, unparseable titles.
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
moveInconsistentPage( $row, $title)
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
require_once RUN_MAINTENANCE_IF_MAIN
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
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Generic class to cleanup a database table.
presenting them properly to the user as errors is done by the caller $title
Allows to change the fields on the form that will be generated $name
static exists( $index)
Returns whether the specified namespace exists.
static makeName( $ns, $title, $fragment='', $interwiki='')
Make a prefixed DB key from a DB key and a namespace index.
error( $err, $die=0)
Throw an error to the user.
output( $out, $channel=null)
Throw some output to the user.
static & singleton()
Get an instance of this class.