I am using the pclzip.lib to unzip a file and I have a problem. I have a function to unzip a file to a directory, and you pass in the file name. Right now it unzips the file to a temp directory but that is not important. I can unzip a large file, or unzip multiple files in one zip however, when I try to call this method twice in the same program, it only unzips the first file. Meaning if i call unzipFile(file1.zip); unzipFile(file2.zip); I get the contents of file1.zip but not file2.zip. Does anyone know why, do I need to do some kind of a close or something? Here is my function.
function unzipFile($unzipPath){
include('incl/pclzip.lib.php');
$archive = new PclZip("{$unzipPath}");
if ($archive->extract(PCLZIP_OPT_PATH, 'tempUnzip',
PCLZIP_OPT_REMOVE_PATH, 'install/release') == 0) {
die("Error : ".$archive->errorInfo(true));
}//if
else{
}//else
}//unzipFile