* @file
*/
+use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\FakeResultWrapper;
/**
* @return bool
*/
protected function loadFile() {
+ $services = MediaWikiServices::getInstance();
if ( $this->mFileLoaded ) {
return true;
}
$this->mFileLoaded = true;
- $this->mFile = wfFindFile( $this->mTitle );
+ $this->mFile = $services->getRepoGroup()->findFile( $this->mTitle );
if ( !$this->mFile ) {
- $this->mFile = wfLocalFile( $this->mTitle ); // always a File
+ $this->mFile = $services->getRepoGroup()->getLocalRepo()
+ ->newFile( $this->mTitle ); // always a File
}
$this->mRepo = $this->mFile->getRepo();
return true;