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 integer */
+ /** @var int */
protected $connTimeout = 10;
- /** @var integer */
+ /** @var int */
protected $reqTimeout = 300;
/** @var bool */
protected $usePipelining = false;
- /** @var integer */
+ /** @var int */
protected $maxConnsPerHost = 50;
/** @var string|null proxy */
protected $proxy;
/**
* @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 );