public function __construct($timeout, $method = self::METHOD_GET) { parent::__construct($timeout, $method); $getOptions = array('http' => array('method' => 'GET', 'timeout' => $this->getTimeout())); $this->_getContext = stream_context_create($getOptions); $this->_postContext = stream_context_create(); $this->_postOptions = array('method' => 'POST', 'timeout' => $this->getTimeout()); }
public function __construct($timeout, $method = self::METHOD_GET) { parent::__construct($timeout, $method); $this->_curl = curl_init(); curl_setopt_array($this->_curl, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_BINARYTRANSFER => true, CURLOPT_HEADER => false)); }