X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportImages.php;h=23bdb3f4cac739091b1a2fd1d9a0673f3b18c602;hb=bdfa96eb726c9997a010f5a194eec71925bfddc2;hp=7f2a9e1de0eeccb1f9cd7729af3260c455a8b4ba;hpb=12846c08cb7f721011952da0aebb95657d7d030c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 7f2a9e1de0..23bdb3f4ca 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -187,6 +187,11 @@ class ImportImages extends Maintenance { if ( $count > 0 ) { foreach ( $files as $file ) { + + if ( $sleep && ( $processed > 0 ) ) { + sleep( $sleep ); + } + $base = UtfNormal\Validator::cleanUp( wfBaseName( $file ) ); # Validate a title @@ -375,10 +380,6 @@ class ImportImages extends Maintenance { if ( $limit && $processed >= $limit ) { break; } - - if ( $sleep ) { - sleep( $sleep ); - } } # Print out some statistics @@ -496,7 +497,7 @@ class ImportImages extends Maintenance { # (preferably batching files too). private function getFileCommentFromSourceWiki( $wiki_host, $file ) { $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' - . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment'; + . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment'; $body = Http::get( $url, [], __METHOD__ ); if ( preg_match( '##', $body, $matches ) == 0 ) { return false; @@ -507,7 +508,7 @@ class ImportImages extends Maintenance { private function getFileUserFromSourceWiki( $wiki_host, $file ) { $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' - . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user'; + . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user'; $body = Http::get( $url, [], __METHOD__ ); if ( preg_match( '##', $body, $matches ) == 0 ) { return false;