Using the Create ZIP File PHP class I have the following line of code
$createZip->get_files_from_folder('blog/wp-content/themes/', 'themes/');
Am I right in thinking that this code gets the files and sub directories from ‘blog/wp-content/themes/’ creates a new folder entitled ‘themes’, and then puts these files and sub directories into this themes folder.
I don’t know which class/library you are using but here is the one that allows you to zip all files present in specified directory:
Create Zip File class
Usage:
Just specify the correct path to variable
$directoryToZipand all files in it will be zipped.