* @ingroup Maintenance
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
/**
$this->output( $title->getPrefixedText() );
if ( $title->getNamespace() == NS_FILE ) {
- $img = wfFindFile( $title, [ 'ignoreRedirect' => true ] );
+ $img = MediaWikiServices::getInstance()->getRepoGroup()->findFile(
+ $title, [ 'ignoreRedirect' => true ]
+ );
if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
$this->output( " FAILED to delete associated file... " );
}