I'm in the process of writing some epub creation functionality using php5. Currently I am attempting to use ZipArchive but have run into a couple annoyances with it. First of all, there is no functionality to set the compression level. Second of all, ZipArchive::addFile()
seems to fail silently and create a corrupt archive whenever I use it. I have been using file_get_contents()
+ ZipArchive::addFromString()
instead but would prefer to just use the documented function for adding files.
I will not post code samples unless someone would really like to help me debug this issue, but rather I'm wondering if there are any other libraries for creating zip (pkzip) archives in PHP that you would recommend. So far, I have seen PclZip, whose site does not seem to be loading, but not much else. I have also considered using exec()
+ zip
(unix command). This code will only run on this one particular linux box so portability is not an issue.
Thanks in advance for any suggestions!