Skip to content

Commit 09006e0

Browse files
author
harry
committed
Implement setInterface()
Implement Curl::setInterface() and MultiCurl::setInterface()
1 parent 73ec46e commit 09006e0

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ Curl::setRetry($mixed)
284284
Curl::setTimeout($seconds)
285285
Curl::setUrl($url, $mixed_data = '')
286286
Curl::setUserAgent($user_agent)
287+
Curl::setInterface($interface)
287288
Curl::setXmlDecoder($mixed)
288289
Curl::success($callback)
289290
Curl::unsetHeader($key)
@@ -335,6 +336,7 @@ MultiCurl::setRetry($mixed)
335336
MultiCurl::setTimeout($seconds)
336337
MultiCurl::setUrl($url)
337338
MultiCurl::setUserAgent($user_agent)
339+
MultiCurl::setInterface($interface)
338340
MultiCurl::setXmlDecoder($mixed)
339341
MultiCurl::start()
340342
MultiCurl::success($callback)

src/Curl/Curl.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,20 @@ public function setUserAgent($user_agent)
12221222
$this->setOpt(CURLOPT_USERAGENT, $user_agent);
12231223
}
12241224

1225+
/**
1226+
* Set Interface
1227+
*
1228+
* The name of the outgoing network interface to use.
1229+
* This can be an interface name, an IP address or a host name.
1230+
*
1231+
* @access public
1232+
* @param $interface
1233+
*/
1234+
public function setInterface($interface)
1235+
{
1236+
$this->setOpt(CURLOPT_INTERFACE, $interface);
1237+
}
1238+
12251239
/**
12261240
* Attempt Retry
12271241
*

src/Curl/MultiCurl.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,20 @@ public function setUserAgent($user_agent)
787787
$this->setOpt(CURLOPT_USERAGENT, $user_agent);
788788
}
789789

790+
/**
791+
* Set Interface
792+
*
793+
* The name of the outgoing network interface to use.
794+
* This can be an interface name, an IP address or a host name.
795+
*
796+
* @access public
797+
* @param $interface
798+
*/
799+
public function setInterface($interface)
800+
{
801+
$this->setOpt(CURLOPT_INTERFACE, $interface);
802+
}
803+
790804
/**
791805
* Start
792806
*

0 commit comments

Comments
 (0)