|
|
@ -333,25 +333,9 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: deprecated, remove
|
|
|
|
// TODO: multiple-argument way is deprecated, first parameter is a hash now
|
|
|
|
function fetch_file_contents($url, $type = false, $login = false, $pass = false, $post_query = false,
|
|
|
|
function fetch_file_contents($options /* previously: 0: $url , 1: $type = false, 2: $login = false, 3: $pass = false,
|
|
|
|
$timeout = false, $timestamp = 0, $useragent = false) {
|
|
|
|
4: $post_query = false, 5: $timeout = false, 6: $timestamp = 0, 7: $useragent = false*/) {
|
|
|
|
|
|
|
|
|
|
|
|
$options = array(
|
|
|
|
|
|
|
|
"url" => $url,
|
|
|
|
|
|
|
|
"type" => $type,
|
|
|
|
|
|
|
|
"login" => $login,
|
|
|
|
|
|
|
|
"pass" => $pass,
|
|
|
|
|
|
|
|
"post_query" => $post_query,
|
|
|
|
|
|
|
|
"timeout" => $timeout,
|
|
|
|
|
|
|
|
"timestamp" => $timestamp,
|
|
|
|
|
|
|
|
"useragent" => $useragent
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return fetch_file_contents2($options);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function fetch_file_contents2($options) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $fetch_last_error;
|
|
|
|
global $fetch_last_error;
|
|
|
|
global $fetch_last_error_code;
|
|
|
|
global $fetch_last_error_code;
|
|
|
@ -359,6 +343,21 @@
|
|
|
|
global $fetch_last_content_type;
|
|
|
|
global $fetch_last_content_type;
|
|
|
|
global $fetch_curl_used;
|
|
|
|
global $fetch_curl_used;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_array($options) && func_num_args() > 1) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// falling back on compatibility shim
|
|
|
|
|
|
|
|
$options = array(
|
|
|
|
|
|
|
|
"url" => func_get_arg(0),
|
|
|
|
|
|
|
|
"type" => @func_get_arg(1),
|
|
|
|
|
|
|
|
"login" => @func_get_arg(2),
|
|
|
|
|
|
|
|
"pass" => @func_get_arg(3),
|
|
|
|
|
|
|
|
"post_query" => @func_get_arg(4),
|
|
|
|
|
|
|
|
"timeout" => @func_get_arg(5),
|
|
|
|
|
|
|
|
"timestamp" => @func_get_arg(6),
|
|
|
|
|
|
|
|
"useragent" => @func_get_arg(7)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$url = $options["url"];
|
|
|
|
$url = $options["url"];
|
|
|
|
$type = isset($options["type"]) ? $options["type"] : false;
|
|
|
|
$type = isset($options["type"]) ? $options["type"] : false;
|
|
|
|
$login = isset($options["login"]) ? $options["login"] : false;
|
|
|
|
$login = isset($options["login"]) ? $options["login"] : false;
|
|
|
|