extract(PCLZIP_OPT_PATH,$filedir);
file_put_contents($filedir.'/data/version',$verinfo['version']);
unlink($filedir.'/xg-pcl-zip.php');
unlink($filedir.'/verinfo.txt');
unlink($path);
unlink(__FILE__);
msg('');
}
if($act=='download'){
$fileHandler = fopen($path, 'w+');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
curl_setopt($ch, CURLOPT_FILE, $fileHandler);
curl_exec($ch);
curl_close($ch);
fclose($fileHandler);
}
if($act=='progress'){
$filesize = filesize($path);
msg($filesize);
}
if(!$act){
?>
讯高CMS安装程序
$msg,'ok'=>true]);
}
function http( $url, $post = null, $flag = 0, $gzip=false, $timeout=60){
$ch = curl_init();
if( !$flag ){
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
}
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);//302redirect
curl_setopt( $ch, CURLOPT_TIMEOUT, $timeout);
if( !empty( $post ) ){
curl_setopt( $ch, CURLOPT_POST, TRUE );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $post );
}
curl_setopt( $ch, CURLOPT_USERAGENT, 'http://xgphp.xg3.cn/');
if($gzip){
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt( $ch, CURLOPT_ENCODING, 'gzip');
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept-Encoding: gzip, deflate'));
}
curl_setopt( $ch, CURLOPT_URL, $url );
$ret = curl_exec( $ch );
curl_close( $ch );
return $ret;
}
?>