r46753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46752‎ | r46753 | r46754 >
Date:03:18, 3 February 2009
Author:demon
Status:deferred
Tags:
Comment:
Use Http::get() here, rather than file_get_contents. That way we can use cURL when available, and only fall back to file_get_contents if need be :)
Modified paths:
  • /trunk/extensions/APC/SpecialAPC.php (modified) (history)
  • /trunk/extensions/ExternalData/ED_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ExternalData/ED_ParserFunctions.php
@@ -144,7 +144,7 @@
145145 // @@todo check date
146146 if ( $res->numRows() == 0 || $get_fresh) {
147147 //echo "do web request: " . $url . "\n";
148 - $page = @file_get_contents( $url );
 148+ $page = Http::get( $url );
149149 if ( $page === false ) {
150150 //echo( "error getting url retrying (".$try_count." of $this->http_number_of_tries)" );
151151 sleep( 1 );
Index: trunk/extensions/APC/SpecialAPC.php
@@ -242,7 +242,7 @@
243243 Xml::element( 'h2', null, wfMsg( 'viewapc-version-info' ) )
244244 );
245245
246 - $rss = @file_get_contents('http://pecl.php.net/feeds/pkg_apc.rss');
 246+ $rss = Http::get( 'http://pecl.php.net/feeds/pkg_apc.rss' );
247247 if (!$rss) {
248248 $wgOut->addWikiMsg( 'viewapc-version-failed' );
249249 } else {

Status & tagging log