示例#1
0
 public function __construct($hosts, $ports, $uri = "", $scheme = "http", $debugHandler = null)
 {
     parent::__construct("", 0, $uri, $scheme, $debugHandler);
     foreach ($hosts as $key => $host) {
         $this->servers_[] = array($host, $ports[$key]);
     }
 }
示例#2
0
 /**
  * Make a new multi-IP HTTP client.
  *
  * @param array  $hosts   List of remote hostnames or IPs.
  * @param mixed  $ports   Array of remote ports, or a single
  *                        common port.
  * @param string $uri     URI of the endpoint.
  * @param string $scheme  http or https
  */
 public function __construct($hosts, $ports, $uri = '', $scheme = 'http', $debugHandler = null)
 {
     parent::__construct(null, null, $uri, $scheme, $debugHandler);
     if (!is_array($ports)) {
         $port = $ports;
         $ports = array();
         foreach ($hosts as $key => $val) {
             $ports[$key] = $port;
         }
     }
     foreach ($hosts as $key => $host) {
         $this->servers_[] = array('host' => $host, 'port' => $ports[$key]);
     }
 }