Page MenuHomeMiraheze

RottenLinks should use HttpRequestFactory
Closed, DuplicatePublic


MediaWiki offers the HttpRequestFactory class to make HTTP calls in a standardised manner. The class ensures MediaWiki's internal logging features (e.g. 'http' log channel) and configurations settings (e.g. http_proxy) are used upon executing HTTP calls. Instead, RottenLinks uses the curl_ functions directly.

Example code (untested!):

$request = MediaWikiServices::getInstance()->getHttpRequestFactory()->create(
		'method' => 'HEAD', // return headers only
		'timeout' => $config->get( 'RottenLinksCurlTimeout' ),
		'userAgent' => 'RottenLinks, MediaWiki extension (, running on ' . $config->get( 'Server' )

return (int)$request->getStatus();

Event Timeline

Southparkfan triaged this task as Normal priority.May 13 2021, 17:13
Southparkfan created this task.
Unknown Object (User) removed a project: Extensions.EditedMay 13 2021, 17:14

Usually we don't tag Extensions when tagging an additional Miraheze extension tag.

John subscribed.

Above task was created for this purpose, which was to overhaul how the detection works.