'img_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'img_actor' : null,
'img_timestamp',
'img_sha1',
- ] + CommentStore::getStore()->getFields( 'img_description' );
+ ] + MediaWikiServices::getInstance()->getCommentStore()->getFields( 'img_description' );
}
/**
* - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
*/
public static function getQueryInfo( array $options = [] ) {
- $commentQuery = CommentStore::getStore()->getJoin( 'img_description' );
+ $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'img_description' );
$actorQuery = ActorMigration::newMigration()->getJoin( 'img_user' );
$ret = [
'tables' => [ 'image' ] + $commentQuery['tables'] + $actorQuery['tables'],
return;
}
- $cache = ObjectCache::getMainWANInstance();
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
$cachedValues = $cache->getWithSetCallback(
$key,
$cache::TTL_WEEK,
$this->repo->getMasterDB()->onTransactionPreCommitOrIdle(
function () use ( $key ) {
- ObjectCache::getMainWANInstance()->delete( $key );
+ MediaWikiServices::getInstance()->getMainWANObjectCache()->delete( $key );
},
__METHOD__
);
function decodeRow( $row, $prefix = 'img_' ) {
$decoded = $this->unprefixRow( $row, $prefix );
- $decoded['description'] = CommentStore::getStore()
+ $decoded['description'] = MediaWikiServices::getInstance()->getCommentStore()
->getComment( 'description', (object)$decoded )->text;
$decoded['user'] = User::newFromAnyId(
) {
$props = $this->repo->getFileProps( $srcPath );
} else {
- $mwProps = new MWFileProps( MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() );
+ $mwProps = new MWFileProps( MediaWikiServices::getInstance()->getMimeAnalyzer() );
$props = $mwProps->getPropsFromPath( $srcPath, true );
}
}
# Test to see if the row exists using INSERT IGNORE
# This avoids race conditions by locking the row until the commit, and also
# doesn't deadlock. SELECT FOR UPDATE causes a deadlock for every race condition.
- $commentStore = CommentStore::getStore();
+ $commentStore = MediaWikiServices::getInstance()->getCommentStore();
list( $commentFields, $commentCallback ) =
$commentStore->insertWithTempTable( $dbw, 'img_description', $comment );
$actorMigration = ActorMigration::newMigration();
$now = time();
$dbw = $this->file->repo->getMasterDB();
- $commentStore = CommentStore::getStore();
+ $commentStore = MediaWikiServices::getInstance()->getCommentStore();
$actorMigration = ActorMigration::newMigration();
$encTimestamp = $dbw->addQuotes( $dbw->timestamp( $now ) );
$dbw = $this->file->repo->getMasterDB();
- $commentStore = CommentStore::getStore();
+ $commentStore = MediaWikiServices::getInstance()->getCommentStore();
$actorMigration = ActorMigration::newMigration();
$status = $this->file->repo->newGood();