Skip to content

Commit c7c0d52

Browse files
committed
Merge pull request #879 from im-denisenko/php7-segfault-2
Partial revert of #868
2 parents 97b9c66 + 62b7bf0 commit c7c0d52

File tree

1 file changed

+2
-54
lines changed

1 file changed

+2
-54
lines changed

lib/Elastica/Transport/Http.php

+2-54
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ public function exec(Request $request, array $params)
139139
// Checks if error exists
140140
$errorNumber = curl_errno($conn);
141141

142-
$response = new Response($responseString, $this->_curlGetInfo($conn, CURLINFO_HTTP_CODE));
142+
$response = new Response($responseString, curl_getinfo($conn, CURLINFO_HTTP_CODE));
143143
$response->setQueryTime($end - $start);
144-
145-
$response->setTransferInfo($this->_curlGetInfo($conn));
144+
$response->setTransferInfo(curl_getinfo($conn));
146145

147146
if ($response->hasError()) {
148147
throw new ResponseException($request, $response);
@@ -188,55 +187,4 @@ protected function _getConnection($persistent = true)
188187

189188
return self::$_curlConnection;
190189
}
191-
192-
/**
193-
* Return information about last request.
194-
*
195-
* @link https://github.com/ruflin/Elastica/issues/861
196-
*
197-
* @param resource $ch
198-
* @param int $opt
199-
*
200-
* @return array
201-
*/
202-
protected function _curlGetInfo($ch, $opt = null)
203-
{
204-
if (!empty($opt)) {
205-
return curl_getinfo($ch, $opt);
206-
}
207-
208-
if (version_compare(phpversion(), 7, '<')) {
209-
return curl_getinfo($ch);
210-
}
211-
212-
return array(
213-
'url' => curl_getinfo($ch, CURLINFO_EFFECTIVE_URL),
214-
'content_type' => curl_getinfo($ch, CURLINFO_CONTENT_TYPE),
215-
'http_code' => curl_getinfo($ch, CURLINFO_HTTP_CODE),
216-
'header_size' => curl_getinfo($ch, CURLINFO_HEADER_SIZE),
217-
'request_size' => curl_getinfo($ch, CURLINFO_REQUEST_SIZE),
218-
'filetime' => curl_getinfo($ch, CURLINFO_FILETIME),
219-
'ssl_verify_result' => curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT),
220-
'redirect_count' => curl_getinfo($ch, CURLINFO_REDIRECT_COUNT),
221-
'total_time' => curl_getinfo($ch, CURLINFO_TOTAL_TIME),
222-
'namelookup_time' => curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME),
223-
'connect_time' => curl_getinfo($ch, CURLINFO_CONNECT_TIME),
224-
'pretransfer_time' => curl_getinfo($ch, CURLINFO_PRETRANSFER_TIME),
225-
'size_upload' => curl_getinfo($ch, CURLINFO_SIZE_UPLOAD),
226-
'size_download' => curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD),
227-
'speed_download' => curl_getinfo($ch, CURLINFO_SPEED_DOWNLOAD),
228-
'speed_upload' => curl_getinfo($ch, CURLINFO_SPEED_UPLOAD),
229-
'download_content_length' => curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD),
230-
'upload_content_length' => curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_UPLOAD),
231-
'starttransfer_time' => curl_getinfo($ch, CURLINFO_STARTTRANSFER_TIME),
232-
'redirect_time' => curl_getinfo($ch, CURLINFO_REDIRECT_TIME),
233-
'certinfo' => curl_getinfo($ch, CURLINFO_CERTINFO),
234-
'primary_ip' => curl_getinfo($ch, CURLINFO_PRIMARY_IP),
235-
'primary_port' => curl_getinfo($ch, CURLINFO_PRIMARY_PORT),
236-
'local_ip' => curl_getinfo($ch, CURLINFO_LOCAL_IP),
237-
'local_port' => curl_getinfo($ch, CURLINFO_LOCAL_PORT),
238-
'redirect_url' => curl_getinfo($ch, CURLINFO_REDIRECT_URL),
239-
'request_header' => curl_getinfo($ch, CURLINFO_HEADER_OUT),
240-
);
241-
}
242190
}

0 commit comments

Comments
 (0)