X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FeraseArchivedFile.php;h=49fadaa2d80233338267d45ae90e98b744b71da9;hb=0e9aa686c6ec3b6a6e247f6f18aaa560ea0bb761;hp=24ef1ed6f67634f39fb235bfaeca544d0b8bf8d9;hpb=6f680554ceb988f3895184167d5006d722a0afb3;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/eraseArchivedFile.php b/maintenance/eraseArchivedFile.php index 24ef1ed6f6..49fadaa2d8 100644 --- a/maintenance/eraseArchivedFile.php +++ b/maintenance/eraseArchivedFile.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/Maintenance.php'; /** @@ -66,7 +68,7 @@ class EraseArchivedFile extends Maintenance { $afile = ArchivedFile::newFromRow( $row ); } - $file = wfLocalFile( $filename ); + $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile( $filename ); if ( $file->exists() ) { $this->fatalError( "File '$filename' is still a public file, use the delete form.\n" ); } @@ -115,5 +117,5 @@ class EraseArchivedFile extends Maintenance { } } -$maintClass = "EraseArchivedFile"; +$maintClass = EraseArchivedFile::class; require_once RUN_MAINTENANCE_IF_MAIN;