|
|
|
@ -6,6 +6,8 @@ class Download { |
|
|
|
* |
|
|
|
* @param string $url URL a telecharger |
|
|
|
* @param string $out Fichier de destination |
|
|
|
* |
|
|
|
* @return array Informations sur le transfert |
|
|
|
*/ |
|
|
|
static function get($url, $out) { |
|
|
|
set_time_limit(0); |
|
|
|
@ -14,9 +16,10 @@ class Download { |
|
|
|
curl_setopt($ch, CURLOPT_FILE, $fp); // write curl response to file
|
|
|
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); |
|
|
|
curl_exec($ch); // get curl response
|
|
|
|
$retour = curl_getinfo($ch); |
|
|
|
curl_close($ch); |
|
|
|
fclose($fp); |
|
|
|
// TODO : retourner info duree transfert
|
|
|
|
return $retour; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|