);
$redis=\rap\cache\Cache::redis();
if($redis){
$redis->select(1);
}
$errArr = \rap\cache\Cache::get('curl_error');
if(!$errArr) $errArr = [];
$errArr [] = ['url'=>$url,'time'=>time()];
\rap\cache\Cache::set('curl_error',$errArr);
throw new Requests_Exception($error, 'curlerror', $this->handle);
}
$this->info = curl_getinfo($this->handle);
$options['hooks']->dispatch('curl.after_request', array(&$this->headers, &$this->info));
return $this->headers;
}
/**
* Collect the headers as they are received
*
* @param resource $handle cURL resource
* @param string $headers Header string
* @return integer Length of provided header
*/
public function stream_headers($handle, $headers) {
// Why do we do this? cURL will send both the final response and any
// interim responses, such as a 100 Continue. We don't need that.
// (We may want to keep this somewhere just in case)
if ($this->done_headers) {
$this->headers = '';
$this->done_headers = false;
}
$this->headers .= $headers;
if ($headers === "\r\n") {
$this->done_headers = true;
}
return strlen($headers);
}
trace调用栈
Requests_Transport_cURL->process_response(...)
Requests_Transport_cURL->request(...)
Requests::request(...)
Requests::get(...)
app\consultant\service\ConsultantService->houseConsultantShow(...)
app\house\pc\controller\NewsController->home(...)
ReflectionMethod->invokeArgs(...)
rap\web\mvc\HandlerAdapter->invokeRequest(...)
rap\web\mvc\ControllerHandlerAdapter->handle(...)
rap\web\mvc\Dispatcher->doDispatch(...)
rap\web\Application->start(...)
require(...)