/** * @internal * @param resource<curl> $ch * @param Aspects\HttpGetRequest $request * @return array(int, Aspects\HttpGetResponse) */ public function exec($ch, $request) { $execStatus = curl_exec($ch); $response = new Aspects\HttpGetResponse(curl_errno($ch), curl_error($ch), curl_getinfo($ch)); $this->onPostDownload->setResponse($response); $this->onPostDownload->notify(); if ($response->needAuth()) { $this->promptAuth($request, $response); } return array($execStatus, $response); }
/** * @internal * @param resource $ch * @param Aspects\HttpGetRequest $request * @return array {int, Aspects\HttpGetResponse} */ public function exec($ch, $request) { $this->_lastHeaders = array(); curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'processHeader')); $execStatus = curl_exec($ch); $response = new Aspects\HttpGetResponse(curl_errno($ch), curl_error($ch), curl_getinfo($ch)); $this->onPostDownload->setResponse($response); $this->onPostDownload->notify(); if ($response->needAuth()) { $this->promptAuth($request, $response); } return array($execStatus, $response); }