* @ingroup Maintenance ExternalStorage
*/
+use MediaWiki\MediaWikiServices;
+
if ( !defined( 'MEDIAWIKI' ) ) {
$optionsWithoutArgs = [ 'fix' ];
require_once __DIR__ . '/../commandLine.inc';
];
function check( $fix = false, $xml = '' ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
if ( $fix ) {
print "Checking, will fix errors if possible...\n";
} else {
return;
}
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$dbw = wfGetDB( DB_MASTER );
$dbr->ping();
$dbw->ping();
$source = new ImportStreamSource( $file );
$importer = new WikiImporter(
$source,
- ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
+ MediaWikiServices::getInstance()->getMainConfig()
);
$importer->setRevisionCallback( [ $this, 'importRevision' ] );
$importer->doImport();
}
// Find text row again
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$oldId = $dbr->selectField( 'revision', 'rev_text_id', [ 'rev_id' => $id ], __METHOD__ );
if ( !$oldId ) {
echo "Missing revision row for rev_id $id\n";