mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-02-03 18:35:04 +00:00
fix curl exec double call
This commit is contained in:
parent
79663c84db
commit
e7e4bb686c
@ -3,6 +3,7 @@
|
|||||||
class Curl {
|
class Curl {
|
||||||
|
|
||||||
private $_connection;
|
private $_connection;
|
||||||
|
private $_response;
|
||||||
|
|
||||||
public function __construct(string $url) {
|
public function __construct(string $url) {
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ class Curl {
|
|||||||
curl_setopt($this->_connection, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($this->_connection, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($this->_connection, CURLOPT_TIMEOUT, 5);
|
curl_setopt($this->_connection, CURLOPT_TIMEOUT, 5);
|
||||||
|
|
||||||
curl_exec($this->_connection);
|
$this->_response = curl_exec($this->_connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
@ -39,6 +40,6 @@ class Curl {
|
|||||||
|
|
||||||
public function getContent() {
|
public function getContent() {
|
||||||
|
|
||||||
return curl_exec($this->_connection);
|
return $this->_response;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user