// @todo FIXME!
$src = $this->getSrc();
- $data = Http::get( $src );
+ $data = Http::get( $src, array(), __METHOD__ );
if ( !$data ) {
wfDebug( "IMPORT: couldn't fetch source $src\n" );
fclose( $f );
# quicker and sorts out user-agent problems which might
# otherwise prevent importing from large sites, such
# as the Wikimedia cluster, etc.
- $data = Http::request( $method, $url, array( 'followRedirects' => true ) );
+ $data = Http::request( $method, $url, array( 'followRedirects' => true ), __METHOD__ );
if ( $data !== false ) {
$file = tmpfile();
fwrite( $file, $data );
* @see ExternalStoreMedium::fetchFromURL()
*/
public function fetchFromURL( $url ) {
- return Http::get( $url );
+ return Http::get( $url, array(), __METHOD__ );
}
/**
$options['timeout'] = 'default';
}
- $req = MWHttpRequest::factory( $url, $options );
+ $req = MWHttpRequest::factory( $url, $options, __METHOD__ );
$req->setUserAgent( ForeignAPIRepo::getUserAgent() );
$status = $req->execute();
wfDebug( "miss\n" );
}
wfDebug( "Fetching shared description from $renderUrl\n" );
- $res = Http::get( $renderUrl );
+ $res = Http::get( $renderUrl, array(), __METHOD__ );
if ( $res && $this->repo->descriptionCacheExpiry > 0 ) {
$wgMemc->set( $key, $res, $this->repo->descriptionCacheExpiry );
}
}
try {
- $text = Http::get( $url . $file, array( 'timeout' => 3 ) );
+ $text = Http::get( $url . $file, array( 'timeout' => 3 ), __METHOD__ );
} catch ( Exception $e ) {
// Http::get throws with allow_url_fopen = false and no curl extension.
$text = null;
if ( MWHttpRequest::canMakeRequests() ) {
$res = MWHttpRequest::factory( $this->mediaWikiAnnounceUrl,
- array( 'method' => 'POST', 'postData' => $params ) )->execute();
+ array( 'method' => 'POST', 'postData' => $params ), __METHOD__ )->execute();
if ( !$res->isOK() ) {
$s->warning( 'config-install-subscribe-fail', $res->getMessage() );
}
wfDebug( __METHOD__ . ": hitting url {$thumbUrl}\n" );
- $request = MWHttpRequest::factory( $thumbUrl, array(
- 'method' => 'HEAD',
- 'followRedirects' => true ) );
+ $request = MWHttpRequest::factory( $thumbUrl,
+ array( 'method' => 'HEAD', 'followRedirects' => true ),
+ __METHOD__
+ );
if ( $wgUploadThumbnailRenderHttpCustomHost ) {
$request->setHeader( 'Host', $wgUploadThumbnailRenderHttpCustomHost );
return $obj->tc_contents;
}
- $req = MWHttpRequest::factory( $url );
+ $req = MWHttpRequest::factory( $url, array(), __METHOD__ );
$status = $req->execute(); // Status object
if ( $status->isOK() ) {
$text = $req->getContent();
// Go on call the external site
// @todo we need a good way to specify a timeout here.
- $ret = Http::get( $url );
+ $ret = Http::get( $url, array(), __METHOD__ );
}
if ( $ret === false ) {
'method' => 'GET',
'timeout' => 'default'
);
- $req = MWHttpRequest::factory( $scalerThumbUrl, $httpOptions );
+ $req = MWHttpRequest::factory( $scalerThumbUrl, $httpOptions, __METHOD__ );
$status = $req->execute();
if ( !$status->isOK() ) {
$errors = $status->getErrorsArray();
'Starting download from "' . $this->mUrl . '" ' .
'<' . implode( ',', array_keys( array_filter( $options ) ) ) . '>'
);
- $req = MWHttpRequest::factory( $this->mUrl, $options );
+ $req = MWHttpRequest::factory( $this->mUrl, $options, __METHOD__ );
$req->setCallback( array( $this, 'saveTempFileChunk' ) );
$status = $req->execute();
}
static function doRequest( $proto ) {
- Http::get( "$proto://localhost/" );
+ Http::get( "$proto://localhost/", array(), __METHOD__ );
}
// bench function 1
$retval = array();
while ( true ) {
- $json = Http::get( wfAppendQuery( 'http://www.mediawiki.org/w/api.php', $params ) );
+ $json = Http::get( wfAppendQuery( 'http://www.mediawiki.org/w/api.php', $params ), array(), __METHOD__ );
$data = FormatJson::decode( $json, true );
foreach ( $data['query']['categorymembers'] as $page ) {
if ( preg_match( '/Manual\:Hooks\/([a-zA-Z0-9- :]+)/', $page['title'], $m ) ) {
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 );
+ $body = Http::get( $url, array(), __METHOD__ );
if ( preg_match( '#<ii comment="([^"]*)" />#', $body, $matches ) == 0 ) {
return false;
}
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 );
+ $body = Http::get( $url, array(), __METHOD__ );
if ( preg_match( '#<ii user="([^"]*)" />#', $body, $matches ) == 0 ) {
return false;
}
$url = wfAppendQuery( $baseUrl, array(
'action' => 'raw',
'title' => "MediaWiki:{$page}" ) );
- $text = Http::get( $url );
+ $text = Http::get( $url, array(), __METHOD__ );
$wikiPage = WikiPage::factory( $title );
$content = ContentHandler::makeContent( $text, $wikiPage->getTitle() );
while ( true ) {
$url = wfAppendQuery( $baseUrl, $data );
- $strResult = Http::get( $url );
+ $strResult = Http::get( $url, array(), __METHOD__ );
$result = FormatJson::decode( $strResult, true );
$page = null;
* HTTP redirects).
*/
public function testRelativeRedirections() {
- $h = MWHttpRequestTester::factory( 'http://oldsite/file.ext' );
+ $h = MWHttpRequestTester::factory( 'http://oldsite/file.ext', array(), __METHOD__ );
# Forge a Location header
$h->setRespHeaders( 'location', array(
"lgname" => $user->username,
"lgpassword" => $user->password
)
- )
+ ),
+ __METHOD__
);
$req->execute();
$url = $this->backend->getFileHttpUrl( array( 'src' => $source ) );
if ( $url !== null ) { // supported
- $data = Http::request( "GET", $url );
+ $data = Http::request( "GET", $url, array(), __METHOD__ );
$this->assertEquals( $content, $data,
"HTTP GET of URL has right contents ($backendName)." );
}