时间:2021-07-01 10:21:17 帮助过:17人阅读
$updatenowinfo = getremotecontent($updatehosturl); //$updatenowinfo = file_get_contents($updatehosturl); if (strstr($updatenowinfo, 'zip')){ $pathurl = file_get_contents($updatehost . '?g=System&m=Verify&a=download&f=' . $updatenowinfo); $resUrl = 'http://www.wqxiu.com'; $pathurl = $resUrl.$pathurl.$updatenowinfo; echo $pathurl; $updatedir = './Conf/logs/Temp/update'; $filepath = $updatedir.'/'.$updatenowinfo; delDirAndFile($updatedir); mkdirs($updatedir); //下载补丁 //if(getremotefile($pathurl,$updatenowinfo,$updatedir)){ $isgot = get_file($pathurl, $updatenowinfo, $updatedir); if($isgot){ $updatezip = $updatedir . '/' . $updatenowinfo; require_once('pclzip.lib.php'); $thisfolder = new PclZip('update.zip'); var_dump($updatezip); $isextract = $thisfolder->extract();
public function test2(){ require_once('pclzip.lib.php'); $archive = new PclZip('archive.zip'); $v_list = $archive->create('update.class.php,index.html'); echo $v_list; $thisfolder = new PclZip('http://www.wqxiu.com/Uploads/resource/V4.7_V4.8updatepackage.zip'); $isextract = $thisfolder->extract(); }
若只是解压的话,可以用php内置的ZipArchive
你先把这个问题解决了再说
可以直接调用linux命令unzip执行。
unzip -d path o.zip
o.zip 为压缩包
path为解压到的目录
你先把这个问题解决了再说