예제 #1
0
 /**
  * 初始化
  */
 function __construct()
 {
     if (HttpClient::is_support_curl()) {
         $this->type = HttpClient::TYPE_CURL;
     } else {
         $this->type = HttpClient::TYPE_FSOCK;
     }
 }
예제 #2
0
 /**
  * @param string $type 指定驱动类型
  */
 function __construct($type = null)
 {
     if ($type) {
         $this->type = $type;
     } elseif (HttpClient::$default_type) {
         $this->type = HttpClient::$default_type;
     } elseif (HttpClient::is_support_curl()) {
         $this->type = HttpClient::TYPE_CURL;
     } else {
         $this->type = HttpClient::TYPE_Fsock;
     }
 }