X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FeraseArchivedFile.php;h=24e88bc3ba24adce5378a74707280ad68f63f516;hb=62991fcb7a5027b1eceb5656829c1c65bf9f98cb;hp=ef6d3d8b895798b99465c824d600b4e15d32059f;hpb=4eff5204d9ec6eb09df70d2fe017a2146cfa4238;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/eraseArchivedFile.php b/maintenance/eraseArchivedFile.php index ef6d3d8b89..24e88bc3ba 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" ); } @@ -107,6 +109,7 @@ class EraseArchivedFile extends Maintenance { $this->output( "Deleted version '$key' ($ts) of file '$name'\n" ); } else { $this->output( "Failed to delete version '$key' ($ts) of file '$name'\n" ); + // @phan-suppress-next-line PhanUndeclaredMethod $this->output( print_r( $status->getErrorsArray(), true ) ); } } else {