Skip to content

Commit 2ae3c69

Browse files
authored
Merge pull request #79 from abacaphiliac/curl-override
allow curl to be overridden.
2 parents b0b75f0 + 67fc761 commit 2ae3c69

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LaunchDarkly/EventProcessor.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class EventProcessor {
1313
private $_host;
1414
private $_port;
1515
private $_ssl;
16+
private $_curl = '/usr/bin/env curl';
1617

1718
public function __construct($apiKey, $options = array()) {
1819
$this->_sdkKey = $apiKey;
@@ -39,6 +40,10 @@ public function __construct($apiKey, $options = array()) {
3940
$this->_path = '';
4041
}
4142
}
43+
44+
if (array_key_exists('curl', $options)) {
45+
$this->_curl = $options['curl'];
46+
}
4247

4348
$this->_capacity = $options['capacity'];
4449
$this->_timeout = $options['timeout'];
@@ -89,7 +94,7 @@ private function createArgs($payload) {
8994
}
9095

9196
private function makeRequest($args) {
92-
$cmd = "/usr/bin/env curl " . $args . ">> /dev/null 2>&1 &";
97+
$cmd = $this->_curl . " " . $args . ">> /dev/null 2>&1 &";
9398
shell_exec($cmd);
9499
return true;
95100
}

0 commit comments

Comments
 (0)