|
@@ -119,6 +119,33 @@ if (!function_exists('http_get')) { |
|
@@ -119,6 +119,33 @@ if (!function_exists('http_get')) { |
|
119
|
}
|
119
|
}
|
|
120
|
}
|
120
|
}
|
|
121
|
|
121
|
|
|
|
|
122
|
+
|
|
|
|
123
|
+if (!function_exists('curl_get')) {
|
|
|
|
124
|
+ function curl_get($url,$is_array=true)
|
|
|
|
125
|
+ {
|
|
|
|
126
|
+ $header = array(
|
|
|
|
127
|
+ 'Expect:',
|
|
|
|
128
|
+ 'Content-Type: application/json; charset=utf-8'
|
|
|
|
129
|
+ );
|
|
|
|
130
|
+ $ch = curl_init($url);
|
|
|
|
131
|
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
132
|
+ curl_setopt($ch, CURLOPT_HEADER, false);
|
|
|
|
133
|
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
|
|
|
134
|
+ curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246');
|
|
|
|
135
|
+ curl_setopt($ch, CURLOPT_AUTOREFERER, true);
|
|
|
|
136
|
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
|
|
|
|
137
|
+ curl_setopt($ch, CURLOPT_TIMEOUT, 120);
|
|
|
|
138
|
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
|
|
|
139
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
140
|
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
|
141
|
+ curl_setopt($ch, CURLOPT_SSLVERSION, 'all');
|
|
|
|
142
|
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
|
143
|
+ $content = curl_exec($ch);
|
|
|
|
144
|
+ curl_close($ch);
|
|
|
|
145
|
+ return $is_array ? json_decode($content, true) : $content;
|
|
|
|
146
|
+ }
|
|
|
|
147
|
+}
|
|
|
|
148
|
+
|
|
122
|
if (!function_exists('curl_c')) {
|
149
|
if (!function_exists('curl_c')) {
|
|
123
|
/**
|
150
|
/**
|
|
124
|
* @param $url
|
151
|
* @param $url
|
|
@@ -148,7 +175,6 @@ if (!function_exists('curl_c')) { |
|
@@ -148,7 +175,6 @@ if (!function_exists('curl_c')) { |
|
148
|
$content = curl_exec($ch);
|
175
|
$content = curl_exec($ch);
|
|
149
|
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
176
|
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
|
150
|
curl_close($ch);
|
177
|
curl_close($ch);
|
|
151
|
-
|
|
|
|
152
|
if($http_code == 200){
|
178
|
if($http_code == 200){
|
|
153
|
return $is_array ? json_decode($content, true) : $content;
|
179
|
return $is_array ? json_decode($content, true) : $content;
|
|
154
|
}else{
|
180
|
}else{
|