Browse Source

ajout info dl

master
jcabillot 6 years ago
parent
commit
e32b0e9201
1 changed files with 4 additions and 1 deletions
  1. 5
      lib/Download.php

5
lib/Download.php

@ -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;
}
}

Loading…
Cancel
Save