$options = [
'fix' => $this->hasOption( 'fix' ),
'merge' => $this->hasOption( 'merge' ),
$options = [
'fix' => $this->hasOption( 'fix' ),
'merge' => $this->hasOption( 'merge' ),
// We'll need to check for lowercase keys as well,
// since we're doing case-sensitive searches in the db.
// We'll need to check for lowercase keys as well,
// since we're doing case-sensitive searches in the db.
$moreNames[] = $contLang->ucwords( $contLang->lc( $name ) );
$moreNames[] = $contLang->ucwordbreaks( $name );
$moreNames[] = $contLang->ucwordbreaks( $contLang->lc( $name ) );
$moreNames[] = $contLang->ucwords( $contLang->lc( $name ) );
$moreNames[] = $contLang->ucwordbreaks( $name );
$moreNames[] = $contLang->ucwordbreaks( $contLang->lc( $name ) );
- $newTitle = $this->getDestinationTitle( $ns, $name,
- $row->page_namespace, $row->page_title, $options );
+ $newTitle = $this->getDestinationTitle(
+ $ns, $name, $row->page_namespace, $row->page_title );
private function checkLinkTable( $table, $fieldPrefix, $ns, $name, $options,
$extraConds = []
) {
private function checkLinkTable( $table, $fieldPrefix, $ns, $name, $options,
$extraConds = []
) {
$batchConds = [];
$fromField = "{$fieldPrefix}_from";
$namespaceField = "{$fieldPrefix}_namespace";
$titleField = "{$fieldPrefix}_title";
$batchSize = 500;
while ( true ) {
$batchConds = [];
$fromField = "{$fieldPrefix}_from";
$namespaceField = "{$fieldPrefix}_namespace";
$titleField = "{$fieldPrefix}_title";
$batchSize = 500;
while ( true ) {
$table,
[ $fromField, $namespaceField, $titleField ],
array_merge( $batchConds, $extraConds, [
$namespaceField => 0,
$table,
[ $fromField, $namespaceField, $titleField ],
array_merge( $batchConds, $extraConds, [
$namespaceField => 0,
foreach ( $res as $row ) {
$logTitle = "from={$row->$fromField} ns={$row->$namespaceField} " .
"dbk={$row->$titleField}";
foreach ( $res as $row ) {
$logTitle = "from={$row->$fromField} ns={$row->$namespaceField} " .
"dbk={$row->$titleField}";
- $destTitle = $this->getDestinationTitle( $ns, $name,
- $row->$namespaceField, $row->$titleField, $options );
+ $destTitle = $this->getDestinationTitle(
+ $ns, $name, $row->$namespaceField, $row->$titleField );
- $encLastTitle = $this->db->addQuotes( $row->$titleField );
- $encLastFrom = $this->db->addQuotes( $row->$fromField );
+ $encLastTitle = $dbw->addQuotes( $row->$titleField );
+ $encLastFrom = $dbw->addQuotes( $row->$fromField );
* @param string $name The conflicting prefix
* @param int $sourceNs The source namespace
* @param int $sourceDbk The source DB key (i.e. page_title)
* @param string $name The conflicting prefix
* @param int $sourceNs The source namespace
* @param int $sourceDbk The source DB key (i.e. page_title)
- private function getDestinationTitle( $ns, $name, $sourceNs, $sourceDbk, $options ) {
+ private function getDestinationTitle( $ns, $name, $sourceNs, $sourceDbk ) {
$dbk = substr( $sourceDbk, strlen( "$name:" ) );
if ( $ns == 0 ) {
// An interwiki; try an alternate encoding with '-' for ':'
$dbk = substr( $sourceDbk, strlen( "$name:" ) );
if ( $ns == 0 ) {
// An interwiki; try an alternate encoding with '-' for ':'
[
"page_namespace" => $newLinkTarget->getNamespace(),
"page_title" => $newLinkTarget->getDBkey(),
[
"page_namespace" => $newLinkTarget->getNamespace(),
"page_title" => $newLinkTarget->getDBkey(),
[ 'imagelinks', 'il' ] ];
foreach ( $fromNamespaceTables as $tableInfo ) {
list( $table, $fieldPrefix ) = $tableInfo;
[ 'imagelinks', 'il' ] ];
foreach ( $fromNamespaceTables as $tableInfo ) {
list( $table, $fieldPrefix ) = $tableInfo;
- $this->beginTransaction( $this->db, __METHOD__ );
- $this->db->update( 'revision',
+ $this->beginTransaction( $dbw, __METHOD__ );
+ $dbw->update( 'revision',
/* Call LinksDeletionUpdate to delete outgoing links from the old title,
* and update category counts.
/* Call LinksDeletionUpdate to delete outgoing links from the old title,
* and update category counts.