X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportImages.php;h=eb13dd120d08562b362174cef7016595518b8f63;hb=449e31a179e337edbc205262bb29476c901d19c5;hp=e733b9a7df692b3cdb7f597d8f53095472f0b8b3;hpb=3b4c53b79540e1ab4519cb7781d3da6cdf8af7b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importImages.php b/maintenance/importImages.php index e733b9a7df..eb13dd120d 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -133,11 +133,11 @@ class ImportImages extends Maintenance { # Check Protection if ( $this->hasOption( 'protect' ) && $this->hasOption( 'unprotect' ) ) { - $this->error( "Cannot specify both protect and unprotect. Only 1 is allowed.\n", 1 ); + $this->fatalError( "Cannot specify both protect and unprotect. Only 1 is allowed.\n" ); } if ( $this->hasOption( 'protect' ) && trim( $this->getOption( 'protect' ) ) ) { - $this->error( "You must specify a protection option.\n", 1 ); + $this->fatalError( "You must specify a protection option.\n" ); } # Prepare the list of allowed extensions @@ -170,7 +170,7 @@ class ImportImages extends Maintenance { if ( $commentFile !== null ) { $comment = file_get_contents( $commentFile ); if ( $comment === false || $comment === null ) { - $this->error( "failed to read comment file: {$commentFile}\n", 1 ); + $this->fatalError( "failed to read comment file: {$commentFile}\n" ); } } else { $comment = $this->getOption( 'comment', 'Importing file' ); @@ -299,7 +299,7 @@ class ImportImages extends Maintenance { " publishing {$file} by '{$wgUser->getName()}', comment '$commentText'... " ); } else { - $mwProps = new MWFileProps( MimeMagic::singleton() ); + $mwProps = new MWFileProps( MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() ); $props = $mwProps->getPropsFromPath( $file, true ); $flags = 0; $publishOptions = []; @@ -440,7 +440,7 @@ class ImportImages extends Maintenance { /** * Split a filename into filename and extension * - * @param string $filename Filename + * @param string $filename * @return array */ private function splitFilename( $filename ) { @@ -519,5 +519,5 @@ class ImportImages extends Maintenance { } -$maintClass = 'ImportImages'; +$maintClass = ImportImages::class; require_once RUN_MAINTENANCE_IF_MAIN;