If you want to use ZipArchive to archive a folder, you will notice that there is no dedicated method to do this. You will need to make a recursive function to do this.
function addDirectoryToZip(&$zip, $dir) {
foreach(glob($dir . '/*') as $file) {
if(is_dir($file))
addDirectoryToZip($zip, $file);
else
$zip->addFile($file);
}
}