From: Moritz Schubotz (physikerwelt) Date: Fri, 2 Feb 2018 15:37:00 +0000 (+0100) Subject: Throw exception if php-curl is missing X-Git-Tag: 1.31.0-rc.0~725^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=commitdiff_plain;h=708875ab329eca4537d47441571b46762d36393c;p=lhc%2Fweb%2Fwiklou.git Throw exception if php-curl is missing Currently MediaWiki just dies silently, if the php curl extension is missing. Throw an exception instead that redirects the admin to the appropriate help page. Change-Id: I25edfcb34ee5451a742cac6ae099019a16f6c417 --- diff --git a/includes/libs/MultiHttpClient.php b/includes/libs/MultiHttpClient.php index 16168e6b59..3282ae2054 100644 --- a/includes/libs/MultiHttpClient.php +++ b/includes/libs/MultiHttpClient.php @@ -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 );