curl order in function
This commit is contained in:
parent
1695d7d242
commit
e9d97b49b1
@ -52,11 +52,6 @@ class helper {
|
|||||||
if(function_exists('file_get_contents') &&
|
if(function_exists('file_get_contents') &&
|
||||||
ini_get('allow_url_fopen') ){
|
ini_get('allow_url_fopen') ){
|
||||||
$url_get_contents_data = @file_get_contents($url); // Masque un warning éventuel
|
$url_get_contents_data = @file_get_contents($url); // Masque un warning éventuel
|
||||||
}elseif(function_exists('fopen') &&
|
|
||||||
function_exists('stream_get_contents') &&
|
|
||||||
ini_get('allow_url_fopen')){
|
|
||||||
$handle = fopen ($url, "r");
|
|
||||||
$url_get_contents_data = stream_get_contents($handle);
|
|
||||||
}elseif(function_exists('curl_version')){
|
}elseif(function_exists('curl_version')){
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
@ -64,6 +59,11 @@ class helper {
|
|||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
$url_get_contents_data = curl_exec($ch);
|
$url_get_contents_data = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
}elseif(function_exists('fopen') &&
|
||||||
|
function_exists('stream_get_contents') &&
|
||||||
|
ini_get('allow_url_fopen')){
|
||||||
|
$handle = fopen ($url, "r");
|
||||||
|
$url_get_contents_data = stream_get_contents($handle);
|
||||||
}else{
|
}else{
|
||||||
$url_get_contents_data = false;
|
$url_get_contents_data = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user