diff --git a/lib/ConsumerStrategies/CurlConsumer.php b/lib/ConsumerStrategies/CurlConsumer.php index aea72a3..c39fe02 100644 --- a/lib/ConsumerStrategies/CurlConsumer.php +++ b/lib/ConsumerStrategies/CurlConsumer.php @@ -35,6 +35,11 @@ class ConsumerStrategies_CurlConsumer extends ConsumerStrategies_AbstractConsume */ protected $_fork = null; + /** + * @var string|null additional verification for endpoint /import + */ + protected $_api_key; + /** * Creates a new CurlConsumer and assigns properties from the $options array @@ -49,6 +54,7 @@ function __construct($options) { $this->_timeout = array_key_exists('timeout', $options) ? $options['timeout'] : 1; $this->_protocol = array_key_exists('use_ssl', $options) && $options['use_ssl'] == true ? "https" : "http"; $this->_fork = array_key_exists('fork', $options) ? ($options['fork'] == true) : false; + $this->_api_key = array_key_exists('api_key', $options) ? $options['api_key'] : null; // ensure the environment is workable for the given settings if ($this->_fork == true) { @@ -100,6 +106,10 @@ protected function _execute($url, $data) { $this->_log("Making blocking cURL call to $url"); } + if(!is_null($this->_api_key)){ + $data .= '&api_key='.$this->_api_key; + } + $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); @@ -144,4 +154,4 @@ protected function _execute_forked($url, $data) { return $return_var == 0; } -} \ No newline at end of file +}