Skip to content

Commit a12839c

Browse files
committed
Throw exception if curl or curl_multi_exec() is not available
Closes elastic#280
1 parent 56b4a3a commit a12839c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Elasticsearch/Client.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,14 @@ class Client
8181
* Client constructor
8282
*
8383
* @param array $params Array of injectable parameters
84+
* @throws Common\Exceptions\RuntimeException
8485
*/
8586
public function __construct($params = array())
8687
{
88+
if (!extension_loaded('curl') || !function_exists('curl_multi_exec')) {
89+
throw new Exceptions\RuntimeException("curl_multi_exec() function is required for the client.");
90+
}
91+
8792
$this->setParams($params);
8893
$this->setLogging();
8994
$this->transport = $this->params['transport'];

0 commit comments

Comments
 (0)