HttpRequestService::__construct PHP Method

__construct() public method

public __construct ( )
    public function __construct()
    {
        $this->ch = curl_init();
        /* cURL settings */
        curl_setopt($this->ch, CURLOPT_USERAGENT, self::$userAgent);
        curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);
        curl_setopt($this->ch, CURLOPT_TIMEOUT, $this->timeout);
        curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->ch, CURLOPT_AUTOREFERER, true);
        curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Expect:'));
        curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
        curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
        curl_setopt($this->ch, CURLOPT_HEADER, false);
    }

Usage Example

コード例 #1
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->APIURL) || empty($this->APIKey) || empty($this->SecretKey)) {
         throw new exception('Invalid API URL or API key or Secret key, please check config.inc.php');
     }
 }
All Usage Examples Of HttpRequestService::__construct