* @author Mij <mij@bitchx.it>
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
class ImportImages extends Maintenance {
$processed = $added = $ignored = $skipped = $overwritten = $failed = 0;
- $this->output( "Import Images\n\n" );
+ $this->output( "Importing Files\n\n" );
$dir = $this->getArg( 0 );
}
# Check existence
- $image = wfLocalFile( $title );
+ $image = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
+ ->newFile( $title );
if ( $image->exists() ) {
if ( $this->hasOption( 'overwrite' ) ) {
$this->output( "{$base} exists, overwriting..." );