Hooks::run( 'ImagePageFindFile', [ $this, &$img, &$this->displayImg ] );
if ( !$img ) { // not set by hook?
- $img = wfFindFile( $this->getTitle() );
+ $services = MediaWikiServices::getInstance();
+ $img = $services->getRepoGroup()->findFile( $this->getTitle() );
if ( !$img ) {
- $img = wfLocalFile( $this->getTitle() );
+ $img = $services->getRepoGroup()->getLocalRepo()->newFile( $this->getTitle() );
}
}
$this->mPage->setFile( $img );
) . "\n"
);
- };
+ }
$out->addHTML( Html::closeElement( 'ul' ) . "\n" );
$res->free();
$out->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
/**
- * @var $file File
+ * @var File $file
*/
foreach ( $dupes as $file ) {
$fromSrc = '';
* @return TitleArray|Title[]
*/
public function getForeignCategories() {
- $this->mPage->getForeignCategories();
+ return $this->mPage->getForeignCategories();
}
}