mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-31 08:54:17 +00:00
update curl library constructor
This commit is contained in:
parent
bb4e97eea3
commit
100d12c6ab
@ -5,12 +5,12 @@ class Curl {
|
||||
private $_connection;
|
||||
private $_response;
|
||||
|
||||
public function __construct(string $url) {
|
||||
public function __construct(string $url, int $connectTimeout = 5) {
|
||||
|
||||
$this->_connection = curl_init($url);
|
||||
|
||||
curl_setopt($this->_connection, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($this->_connection, CURLOPT_TIMEOUT, 5);
|
||||
curl_setopt($this->_connection, CURLOPT_CONNECTTIMEOUT, $connectTimeout);
|
||||
|
||||
$this->_response = curl_exec($this->_connection);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user