class MultiHttpClient implements LoggerAwareInterface {
/** @var resource */
protected $multiHandle = null; // curl_multi handle
- /** @var string|null SSL certificates path */
+ /** @var string|null SSL certificates path */
protected $caBundlePath;
/** @var int */
protected $connTimeout = 10;
* - error : Any cURL error string
* The map also stores integer-indexed copies of these values. This lets callers do:
* @code
- * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $http->run( $req );
+ * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $http->run( $req );
* @endcode
* @param array $req HTTP request array
* @param array $opts
/**
* @return resource
+ * @throws Exception
*/
protected function getCurlMulti() {
if ( !$this->multiHandle ) {
+ if ( !function_exists( 'curl_multi_init' ) ) {
+ throw new Exception( "PHP cURL extension missing. " .
+ "Check https://www.mediawiki.org/wiki/Manual:CURL" );
+ }
$cmh = curl_multi_init();
curl_multi_setopt( $cmh, CURLMOPT_PIPELINING, (int)$this->usePipelining );
curl_multi_setopt( $cmh, CURLMOPT_MAXCONNECTS, (int)$this->maxConnsPerHost );