protected $isSafeFile;
/** @var string Required Repository class type */
- protected $repoClass = 'FileRepo';
+ protected $repoClass = FileRepo::class;
/** @var array Cache of tmp filepaths pointing to generated bucket thumbnails, keyed by width */
protected $tmpBucketedThumbCache = [];
$oldMime = $old->getMimeType();
$n = strrpos( $new, '.' );
$newExt = self::normalizeExtension( $n ? substr( $new, $n + 1 ) : '' );
- $mimeMagic = MimeMagic::singleton();
+ $mimeMagic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
return $mimeMagic->isMatchingExtension( $newExt, $oldMime );
}
// Purge cache of all pages using this file
$title = $this->getTitle();
if ( $title ) {
- DeferredUpdates::addUpdate( new HTMLCacheUpdate( $title, 'imagelinks' ) );
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $title, 'imagelinks', 'file-purge' )
+ );
}
}