X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportImages.inc;h=4b839a0f8ac0c4f8b5bcd25b6295c2406ff99601;hb=baddcab658195e9f2438b24f15030564e2fbd925;hp=ae93287df1510007801a2beeed451c793a767451;hpb=e78776373e14c8dc208b0045bf83a44e671d6f00;p=lhc%2Fweb%2Fwiklou.git
diff --git a/maintenance/importImages.inc b/maintenance/importImages.inc
index ae93287df1..4b839a0f8a 100644
--- a/maintenance/importImages.inc
+++ b/maintenance/importImages.inc
@@ -46,6 +46,7 @@ function findFiles( $dir, $exts, $recurse = false ) {
$files = array_merge( $files, findFiles( $dir . '/' . $file, $exts, true ) );
}
}
+
return $files;
} else {
return array();
@@ -63,9 +64,10 @@ function findFiles( $dir, $exts, $recurse = false ) {
*/
function splitFilename( $filename ) {
$parts = explode( '.', $filename );
- $ext = $parts[ count( $parts ) - 1 ];
- unset( $parts[ count( $parts ) - 1 ] );
+ $ext = $parts[count( $parts ) - 1];
+ unset( $parts[count( $parts ) - 1] );
$fname = implode( '.', $parts );
+
return array( $fname, $ext );
}
@@ -110,10 +112,12 @@ function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) {
return false;
}
-# FIXME: Access the api in a saner way and performing just one query (preferably batching files too).
+# @todo FIXME: Access the api in a saner way and performing just one query
+# (preferably batching files too).
function getFileCommentFromSourceWiki( $wiki_host, $file ) {
- $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
- $body = Http::get( $url );
+ $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:'
+ . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
+ $body = Http::get( $url, array(), __METHOD__ );
if ( preg_match( '##', $body, $matches ) == 0 ) {
return false;
}
@@ -122,8 +126,9 @@ function getFileCommentFromSourceWiki( $wiki_host, $file ) {
}
function getFileUserFromSourceWiki( $wiki_host, $file ) {
- $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
- $body = Http::get( $url );
+ $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:'
+ . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
+ $body = Http::get( $url, array(), __METHOD__ );
if ( preg_match( '##', $body, $matches ) == 0 ) {
return false;
}