X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportImages.php;h=0c4ff0af50247d514bd4e5e0c3a0b11eac6c7f28;hb=82bd6b026ef6ecb7f2fe15acaa40c608680dfff1;hp=f6be840d71831a8a859d71f00782418a64027bd6;hpb=45fcf5f94f7a13308665d637e2a5cd81550d1493;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importImages.php b/maintenance/importImages.php index f6be840d71..0c4ff0af50 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -200,7 +200,8 @@ class ImportImages extends Maintenance { $title = Title::makeTitleSafe( NS_FILE, $base ); if ( !is_object( $title ) ) { $this->output( - "{$base} could not be imported; a valid title cannot be produced\n" ); + "{$base} could not be imported; a valid title cannot be produced\n" + ); continue; } @@ -246,7 +247,8 @@ class ImportImages extends Maintenance { if ( $dupes ) { $this->output( - "{$base} already exists as {$dupes[0]->getName()}, skipping\n" ); + "{$base} already exists as {$dupes[0]->getName()}, skipping\n" + ); $skipped++; continue; } @@ -274,7 +276,8 @@ class ImportImages extends Maintenance { if ( $wgUser === false ) { # user does not exist in target wiki $this->output( - "failed: user '$real_user' does not exist in target wiki." ); + "failed: user '$real_user' does not exist in target wiki." + ); continue; } } @@ -291,7 +294,8 @@ class ImportImages extends Maintenance { $commentText = file_get_contents( $f ); if ( !$commentText ) { $this->output( - " Failed to load comment file {$f}, using default comment. " ); + " Failed to load comment file {$f}, using default comment. " + ); } } } @@ -322,7 +326,7 @@ class ImportImages extends Maintenance { $archive = $image->publish( $file, $flags, $publishOptions ); if ( !$archive->isGood() ) { $this->output( "failed. (" . - $archive->getWikiText( false, false, 'en' ) . + $archive->getMessage( false, false, 'en' )->text() . ")\n" ); $failed++; continue; @@ -361,7 +365,7 @@ class ImportImages extends Maintenance { # Protect the file $this->output( "\nWaiting for replica DBs...\n" ); // Wait for replica DBs. - sleep( 2.0 ); # Why this sleep? + sleep( 2 ); # Why this sleep? wfWaitForSlaves(); $this->output( "\nSetting image restrictions ... " );