Merge pull request #110 from richard-underwood/issue-109

PHP <= 5.4 fix for curl_reset
This commit is contained in:
Tuxis Internet Engineering V.O.F 2016-08-26 11:50:48 +02:00 committed by GitHub
commit 531f8a2609

View file

@ -44,7 +44,11 @@ class ApiHandler {
$this->authheaders(); $this->authheaders();
$this->addheader('Accept', 'application/json'); $this->addheader('Accept', 'application/json');
curl_reset($this->curlh); if(defined('curl_reset')) {
curl_reset($this->curlh);
} else {
$this->curlh = curl_init();
}
curl_setopt($this->curlh, CURLOPT_HTTPHEADER, Array()); curl_setopt($this->curlh, CURLOPT_HTTPHEADER, Array());
curl_setopt($this->curlh, CURLOPT_RETURNTRANSFER, 1); curl_setopt($this->curlh, CURLOPT_RETURNTRANSFER, 1);