Page MenuHomePhabricator

Collection uses curl_*() functions instead of Http::*() functions
Closed, ResolvedPublic

Description

MediaWiki has an Http class (see includes/HttpFunctions.php) wrapping cURL which falls back to fopen() if cURL is unavailable and throwing a helpful exception if neither is available.

On the other hand Collection uses curl_*() functions directly. This doesn't allow for fallback to fopen() and doesn't display a helpful exception when cURL is unavailable but causes an opaque fatal error which has to be dug up from the error log.


Version: unspecified
Severity: enhancement

Details

Reference
bz24512

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:04 PM
bzimport added a project: Collection.
bzimport set Reference to bz24512.

The MediaWiki Http class does not support POST requests. A POST request is required to send the book to a render server. Therefor, switching to HTTP::*() is not an option. The cURL module is a requirement for the collection extension to work.

I suggest to display a prominent error message in case the cURL module is not installed.

Yes it does

		$http = MWHttpRequest::factory( 'http://www.address.com',
			array(
				'method' => 'POST',
				'postData' => array(
					'foo' => 'bar',
				)
			)
		);

(In reply to comment #3)

Yes it does

ok - my bad. Should be no problem to fix, then.