exceptions, largely so the API can handle them more sensibly.
* Blocks created automatically by MediaWiki, such as for configured proxies or
dnsbls, are now indicated as such and use a new i18n message when displayed.
+* Added new $wgHTTPImportTimeout setting. Sets timeout for
+ downloading the XML dump during a transwiki import in seconds.
=== External library changes in 1.29 ===
*/
$wgHTTPTimeout = 25;
+/**
+ * Timeout for HTTP requests done internally for transwiki imports, in seconds.
+ * @since 1.29
+ */
+$wgHTTPImportTimeout = 25;
+
/**
* Timeout for Asynchronous (background) HTTP requests, in seconds.
*/
* @return Status
*/
static function newFromURL( $url, $method = 'GET' ) {
+ global $wgHTTPImportTimeout;
wfDebug( __METHOD__ . ": opening $url\n" );
# Use the standard HTTP fetch function; it times out
# 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, [ 'followRedirects' => true ], __METHOD__ );
+ $data = Http::request(
+ $method,
+ $url,
+ [
+ 'followRedirects' => true,
+ 'timeout' => $wgHTTPImportTimeout
+ ],
+ __METHOD__
+ );
if ( $data !== false ) {
$file = tmpfile();
fwrite( $file, $data );