aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/rebuildImages.php
diff options
context:
space:
mode:
authorDerick Alangi <alangiderick@gmail.com>2019-05-14 18:00:34 +0100
committerD3r1ck01 <xsavitar.wiki@aol.com>2019-06-11 13:26:37 +0000
commit21e2d71560cb87191dd80ae0750d0190b45063c1 (patch)
treea0088f08e76373bc0cd01e78531829e172210d6e /maintenance/rebuildImages.php
parenta6dce8b8cd0b665ed4a00ad6bdcfabf69f2925c3 (diff)
downloadmediawikicore-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 'maintenance/rebuildImages.php')
-rw-r--r--maintenance/rebuildImages.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php
index c0de33412e0f..dfce2021e640 100644
--- a/maintenance/rebuildImages.php
+++ b/maintenance/rebuildImages.php
@@ -195,9 +195,9 @@ class ImageBuilder extends Maintenance {
function addMissingImage( $filename, $fullpath ) {
$timestamp = $this->dbw->timestamp( $this->getRepo()->getFileTimestamp( $fullpath ) );
+ $services = MediaWikiServices::getInstance();
- $altname = MediaWikiServices::getInstance()->getContentLanguage()->
- checkTitleEncoding( $filename );
+ $altname = $services->getContentLanguage()->checkTitleEncoding( $filename );
if ( $altname != $filename ) {
if ( $this->dryrun ) {
$filename = $altname;
@@ -214,7 +214,7 @@ class ImageBuilder extends Maintenance {
return;
}
if ( !$this->dryrun ) {
- $file = wfLocalFile( $filename );
+ $file = $services->getRepoGroup()->getLocalRepo()->newFile( $filename );
if ( !$file->recordUpload(
'',
'(recovered file, missing upload log entry)',