max_bodysize = 32777216; $http->timeout = 120; $http->keep_alive = false; $data = $http->get($url); if(!$data) { qs_say($helper->getLang('download_fail'), $gzfile); return; } $fp = @fopen($gzfile,'wb'); if($fp === false) { qs_say($helper->getLang('write_fail'), $gzfile); return; } if(!fwrite($fp,$data)) { qs_say($helper->getLang('write_fail'), $gzfile); return; } fclose($fp); qs_say($helper->getLang('file_saved'), $gzfile); $gz = gzopen($gzfile, "rb"); $data= gzread($gz, 32777216); gzclose($gz); if( io_saveFile($data_file, $data)) { qs_say($helper->getLang('file_saved'), $data_file); } else { qs_say($helper->getLang('no_unpack'), $gzfile); return; } if(!$geoip_local) { qs_say($helper->getLang('no_geoip_local')); } } function qs_say(){ $args = func_get_args(); echo vsprintf(array_shift($args)."\n",$args); ob_flush(); } get_GeoLiteCity('GeoLiteCity.dat'); get_GeoLiteCity('GeoIPv6.dat');