X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildImages.php;h=dfce2021e6403464a7a03413b696f69a90f80dd5;hb=7462d3075a23095fd627cebeb0f66e081ad2bede;hp=713492a285963ef3565458c07e181bf74816b3b4;hpb=16c80e429be5904fb42a93f260f8de3d18f0c692;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 713492a285..dfce2021e6 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -32,6 +32,7 @@ require_once __DIR__ . '/Maintenance.php'; +use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\IMaintainableDatabase; /** @@ -193,11 +194,10 @@ class ImageBuilder extends Maintenance { } function addMissingImage( $filename, $fullpath ) { - global $wgContLang; - $timestamp = $this->dbw->timestamp( $this->getRepo()->getFileTimestamp( $fullpath ) ); + $services = MediaWikiServices::getInstance(); - $altname = $wgContLang->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)',