Skip to content

Commit

Permalink
支持php5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wkt committed May 17, 2015
1 parent 578ecb8 commit 5ea31c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion facepp_sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ private function request($request_url, $request_body)
curl_setopt($curl_handle, CURLOPT_URL, $request_url);
curl_setopt($curl_handle, CURLOPT_FILETIME, true);
curl_setopt($curl_handle, CURLOPT_FRESH_CONNECT, false);
curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
if(version_compare(phpversion(),"5.5","<=")){
curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY,CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
}else{
curl_setopt($curl_handle, CURLOPT_SAFE_UPLOAD, false);
}
curl_setopt($curl_handle, CURLOPT_MAXREDIRS, 5);
curl_setopt($curl_handle, CURLOPT_HEADER, false);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
Expand All @@ -62,6 +66,7 @@ private function request($request_url, $request_body)
curl_setopt($curl_handle, CURLOPT_NOSIGNAL, true);
curl_setopt($curl_handle, CURLOPT_REFERER, $request_url);
curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent);


if (extension_loaded('zlib')) {
curl_setopt($curl_handle, CURLOPT_ENCODING, '');
Expand Down

1 comment on commit 5ea31c2

@tytymnty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

Please sign in to comment.