X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FeraseArchivedFile.php;h=49fadaa2d80233338267d45ae90e98b744b71da9;hb=0ef534a4ff69d4714168c199d3b426dfb0cecca7;hp=24ef1ed6f67634f39fb235bfaeca544d0b8bf8d9;hpb=57fb649603a94ea8244c50be0070d3074ca14d6e;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;