diff options
author | Derick Alangi <alangiderick@gmail.com> | 2019-05-14 18:00:34 +0100 |
---|---|---|
committer | D3r1ck01 <xsavitar.wiki@aol.com> | 2019-06-11 13:26:37 +0000 |
commit | 21e2d71560cb87191dd80ae0750d0190b45063c1 (patch) | |
tree | a0088f08e76373bc0cd01e78531829e172210d6e /includes/api/ApiQueryImageInfo.php | |
parent | a6dce8b8cd0b665ed4a00ad6bdcfabf69f2925c3 (diff) | |
download | mediawikicore-21e2d71560cb87191dd80ae0750d0190b45063c1.tar.gz mediawikicore-21e2d71560cb87191dd80ae0750d0190b45063c1.zip |
Replace some uses of deprecated wfFindFile() and wfLocalFile()
These global functions were deprecated in 1.34 and services made
available to replace them. See services below;
* wfFindFile() - MediaWikiServices::getInstance()->getRepoGroup()->findFile()
* wfLocalFind() - MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile()
NOTES:
* wfFindFile() and wfLocalFind() usages in tests have been ignored
in this change per @Timo's comments about state of objects.
* includes/upload/UploadBase.php also maintained for now as it causes
some failures I don't fully understand, will investigate and handle
it in a follow up patch.
* Also, includes/MovePage.php
Change-Id: I9437494de003f40fbe591321da7b42d16bb732d6
Diffstat (limited to 'includes/api/ApiQueryImageInfo.php')
-rw-r--r-- | includes/api/ApiQueryImageInfo.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 051e12796f08..e123a2ac468c 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -110,7 +110,8 @@ class ApiQueryImageInfo extends ApiQueryBase { if ( !isset( $images[$title] ) ) { if ( isset( $prop['uploadwarning'] ) || isset( $prop['badfile'] ) ) { // uploadwarning and badfile need info about non-existing files - $images[$title] = wfLocalFile( $title ); + $images[$title] = MediaWikiServices::getInstance()->getRepoGroup() + ->getLocalRepo()->newFile( $title ); // Doesn't exist, so set an empty image repository $info['imagerepository'] = ''; } else { |