* @ingroup Maintenance
*/
-use MediaWiki\Linker\LinkTarget;
-
require_once __DIR__ . '/Maintenance.php';
+use MediaWiki\Linker\LinkTarget;
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
/**
* Maintenance script that checks for articles to fix after
* adding/deleting namespaces.
class NamespaceConflictChecker extends Maintenance {
/**
- * @var DatabaseBase
+ * @var IMaintainableDatabase
*/
protected $db;
* @return array
*/
private function getInterwikiList() {
- $result = Interwiki::getAllPrefixes();
+ $result = MediaWikiServices::getInstance()->getInterwikiLookup()->getAllPrefixes();
$prefixes = [];
foreach ( $result as $row ) {
$prefixes[] = $row['iw_prefix'];
$ok = true;
foreach ( $targets as $row ) {
-
// Find the new title and determine the action to take
$newTitle = $this->getDestinationTitle( $ns, $name,
/**
* Merge page histories
*
- * @param integer $id The page_id
+ * @param stdClass $row Page row
* @param Title $newTitle The new title
* @return bool
*/
* accidentally introduce an assumption of title validity to the code we
* are calling.
*/
- $updates = [ new LinksDeletionUpdate( $wikiPage ) ];
- DataUpdate::runUpdates( $updates );
+ DeferredUpdates::addUpdate( new LinksDeletionUpdate( $wikiPage ) );
+ DeferredUpdates::doUpdates();
return true;
}