|
|
|
@ -6,8 +6,8 @@ class Curl
@@ -6,8 +6,8 @@ class Curl
|
|
|
|
|
private $_response; |
|
|
|
|
|
|
|
|
|
public function __construct(string $url, |
|
|
|
|
array $post = [], |
|
|
|
|
string $userAgent = 'YGGtracker', |
|
|
|
|
array $post = [], |
|
|
|
|
int $connectTimeout = 10, |
|
|
|
|
bool $header = false, |
|
|
|
|
bool $followLocation = false, |
|
|
|
@ -17,6 +17,11 @@ class Curl
@@ -17,6 +17,11 @@ class Curl
|
|
|
|
|
{ |
|
|
|
|
$this->_connection = curl_init($url); |
|
|
|
|
|
|
|
|
|
if ($userAgent) |
|
|
|
|
{ |
|
|
|
|
curl_setopt($this->_connection, CURLOPT_USERAGENT, $userAgent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($post)) |
|
|
|
|
{ |
|
|
|
|
curl_setopt($this->_connection, CURLOPT_POST, true); |
|
|
|
@ -38,11 +43,6 @@ class Curl
@@ -38,11 +43,6 @@ class Curl
|
|
|
|
|
curl_setopt($this->_connection, CURLOPT_SSL_VERIFYHOST, $sslVerifyHost); |
|
|
|
|
curl_setopt($this->_connection, CURLOPT_SSL_VERIFYPEER, $sslVerifyPeer); |
|
|
|
|
|
|
|
|
|
if ($userAgent) |
|
|
|
|
{ |
|
|
|
|
curl_setopt($this->_connection, CURLOPT_USERAGENT, $userAgent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$this->_response = curl_exec($this->_connection); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|