"; if($completePath != $completeName && substr($completeName, -1) != "/"){ if (zip_entry_open($zip, $zip_entry, "r")){ if ($fd = @fopen($completeName, 'w+')){ fwrite($fd, zip_entry_read($zip_entry, zip_entry_filesize($zip_entry))); fclose($fd); } } else{ makeDir($completeName, 0777); } } zip_entry_close($zip_entry); } zip_close($zip); @unlink($zipFile); $url = "http://".$_SERVER['HTTP_HOST'].$installDirecotry.$redirectUrl; header("Location:$url"); exit; } } function createInstallDireoctory($installDirecotry){ if(substr($installDirecotry, -1) != "/"){ $installDirecotry .= "/"; } if(substr($installDirecotry, 0, 1) != "/"){ $installDirecotry = "/".$installDirecotry; } if($installDirecotry == "//"){ $installDirecotry = "/"; } makeDir($installDirecotry,0777 ); return $installDirecotry; } function makeDir($dir){ $dirs = explode('/',$dir); $tmp = "/"; foreach($dirs as $dir){ $tmp .= "$dir/"; @mkdir($tmp, 0777); } } $packageName = $_GET['p']; $url = $_GET['u']; $installDir = createInstallDireoctory($_GET['d']); getPackage($packageName, $installDir); installPackage($packageName, $installDir, $url); ?>