r62092 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62091‎ | r62092 | r62093 >
Date:18:39, 7 February 2010
Author:platonides
Status:ok
Tags:
Comment:
file_get_contents -> Http::get per ^demon
Modified paths:
  • /trunk/phase3/maintenance/importImages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/importImages.inc
@@ -92,7 +92,7 @@
9393 # FIXME: Access the api in a saner way and performing just one query (preferably batching files too).
9494 function getFileCommentFromSourceWiki($wiki_host, $file) {
9595 $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
96 - $body = file_get_contents($url);
 96+ $body = Http::get($url);
9797 if (preg_match('#<ii comment="([^"]*)" />#', $body, $matches) == 0) {
9898 return false;
9999 }
@@ -102,7 +102,7 @@
103103
104104 function getFileUserFromSourceWiki($wiki_host, $file) {
105105 $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
106 - $body = file_get_contents($url);
 106+ $body = Http::get($url);
107107 if (preg_match('#<ii user="([^"]*)" />#', $body, $matches) == 0) {
108108 return false;
109109 }

Status & tagging log