From 67fc7611f30589f9f4c9d32210f20d2b8616e065 Mon Sep 17 00:00:00 2001 From: Tim Younger Date: Fri, 12 May 2017 16:48:14 -0700 Subject: [PATCH] allow curl to be overridden. --- src/LaunchDarkly/EventProcessor.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/LaunchDarkly/EventProcessor.php b/src/LaunchDarkly/EventProcessor.php index 4e2c2ea12..cfa74043e 100644 --- a/src/LaunchDarkly/EventProcessor.php +++ b/src/LaunchDarkly/EventProcessor.php @@ -13,6 +13,7 @@ class EventProcessor { private $_host; private $_port; private $_ssl; + private $_curl = '/usr/bin/env curl'; public function __construct($apiKey, $options = array()) { $this->_sdkKey = $apiKey; @@ -39,6 +40,10 @@ public function __construct($apiKey, $options = array()) { $this->_path = ''; } } + + if (array_key_exists('curl', $options)) { + $this->_curl = $options['curl']; + } $this->_capacity = $options['capacity']; $this->_timeout = $options['timeout']; @@ -89,7 +94,7 @@ private function createArgs($payload) { } private function makeRequest($args) { - $cmd = "/usr/bin/env curl " . $args . ">> /dev/null 2>&1 &"; + $cmd = $this->_curl . " " . $args . ">> /dev/null 2>&1 &"; shell_exec($cmd); return true; }