Skip to content

Commit 40988fa

Browse files
committed
Merge pull request php-curl-class#198 from zachborboa/master
Add method setConnectTimeout()
2 parents 5231bf4 + f33a8c1 commit 40988fa

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Curl::post($url, $data = array())
173173
Curl::progress($callback)
174174
Curl::put($url, $data = array())
175175
Curl::setBasicAuthentication($username, $password = '')
176+
Curl::setConnectTimeout($seconds)
176177
Curl::setCookie($key, $value)
177178
Curl::setCookieFile($cookie_file)
178179
Curl::setCookieJar($cookie_jar)
@@ -183,6 +184,7 @@ Curl::setDigestAuthentication($username, $password = '')
183184
Curl::setHeader($key, $value)
184185
Curl::setJsonDecoder($function)
185186
Curl::setOpt($option, $value)
187+
Curl::setPort($port)
186188
Curl::setReferer($referer)
187189
Curl::setReferrer($referrer)
188190
Curl::setTimeout($seconds)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"name": "Zach Borboa"
1313
}
1414
],
15-
"version": "3.5.5",
15+
"version": "3.6.5",
1616
"require": {
1717
"php": ">=5.3",
1818
"ext-curl": "*"

src/Curl/Curl.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Curl
66
{
7-
const VERSION = '3.5.5';
7+
const VERSION = '3.6.5';
88
const DEFAULT_TIMEOUT = 30;
99

1010
public $curl;
@@ -550,6 +550,17 @@ public function setPort($port)
550550
$this->setOpt(CURLOPT_PORT, intval($port));
551551
}
552552

553+
/**
554+
* Set Connect Timeout
555+
*
556+
* @access public
557+
* @param $seconds
558+
*/
559+
public function setConnectTimeout($seconds)
560+
{
561+
$this->setOpt(CURLOPT_CONNECTTIMEOUT, $seconds);
562+
}
563+
553564
/**
554565
* Set Cookie File
555566
*

0 commit comments

Comments
 (0)