Inside webserver, I'm downloading zip and unziping with function below.
$zip = new ZipArchive;
$res = $zip->open('tip.zip');
if ($res === TRUE) {
$zip->extractTo("$dest/");
$zip->close();
} else {
die('ZIP not supported on this server!');
}
The problem is, when I unzip with this script, I am getting the folder inside zip (there is folder inside zip). But, I need to get files, folders inside zip's child folder, not folder itself.
In other words
So I need:
- to execute some function like moveRecursively("$username-$reponame-$node", $destination); where $destination is root and then delete this folder
- or do this action somehow while unziping and unzip driectly child folders contents into folder where script located (public_html in my case)
Can't figure out solution. Please help.