Services: Convert PasswordReset's static to a const now HHVM is gone
[lhc/web/wiklou.git] / maintenance / deleteBatch.php
index 4f9e488..ee6e3e5 100644 (file)
@@ -28,6 +28,8 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\MediaWikiServices;
+
 require_once __DIR__ . '/Maintenance.php';
 
 /**
@@ -98,7 +100,9 @@ class DeleteBatch extends Maintenance {
 
                        $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... " );
                                }