protected function fetch($j) { $k = curl_exec($this->curl); $l = curl_error($this->curl); $m = curl_getinfo($this->curl, CURLINFO_HTTP_CODE); $j[0]["code"] = $m; if ($l) { MyLog::checkLogError($l, "curl", $j); } $n = MyLog::microtime_float() - $this->start_generate_time; $this->start_generate_time = MyLog::microtime_float(); MyLog::checkLogSlow($n, "curl", $j); return $k; }
/** * Fetch * * Execute the curl object * * @return StdClass * @access protected * @throws ApiException */ protected function fetch($debug_backtrace) { $raw_response = curl_exec($this->curl); $error = curl_error($this->curl); $code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE); $debug_backtrace[0]["code"] = $code; if ($error) { //bat dau ghi log loi vao file MyLog::checkLogError($error, "curl", $debug_backtrace); } //curl_close($this->curl); //bat dau tinh thoi gian xu ly $time_request = MyLog::microtime_float() - $this->start_generate_time; //sau day tiep tuc gan lai thoi gian de xu ly tiep $this->start_generate_time = MyLog::microtime_float(); //kiem tra xem time request co bi slow qua ko MyLog::checkLogSlow($time_request, "curl", $debug_backtrace); return $raw_response; }