Merge "Add tablesUsed to RevisionStoreDbTest"
[lhc/web/wiklou.git] / includes / libs / MultiHttpClient.php
index 6c48cee..3282ae2 100644 (file)
@@ -50,13 +50,13 @@ class MultiHttpClient implements LoggerAwareInterface {
        protected $multiHandle = null; // curl_multi handle
        /** @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;
@@ -421,9 +421,14 @@ class MultiHttpClient implements LoggerAwareInterface {
 
        /**
         * @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 );